@TriggerTreeKind(Tree.Kind.CLASS) public static Collection<ErrorDescription> run(HintContext hintContext) { List<ErrorDescription> problems = new ArrayList<>(); final JsfHintsContext ctx = JsfHintsUtils.getOrCacheContext(hintContext); Project project = ctx.getProject(); if (project == null) { return problems; } CompilationInfo info = ctx.getCompilationInfo(); for (TypeElement typeElement : info.getTopLevelElements()) { for (AnnotationMirror annotationMirror : typeElement.getAnnotationMirrors()) { if (FLOW_SCOPED.equals(annotationMirror.getAnnotationType().toString())) { // it's FlowScoped bean -> check the CDI CdiUtil cdiUtil = project.getLookup().lookup(CdiUtil.class); if (cdiUtil == null || !cdiUtil.isCdiEnabled()) { Tree tree = info.getTrees().getTree(typeElement, annotationMirror); problems.add(JsfHintsUtils.createProblem( tree, info, Bundle.FlowScopedBeanWithoutCdi_display_name(), Severity.WARNING, Arrays.<Fix>asList(new FixCdiAvailability(project)))); } } } } return problems; }
@TriggerTreeKind(Tree.Kind.CLASS) public static Collection<ErrorDescription> run(HintContext hintContext) { List<ErrorDescription> problems = new ArrayList<>(); final JsfHintsContext ctx = JsfHintsUtils.getOrCacheContext(hintContext); if (ctx.getJsfVersion() == null || !ctx.getJsfVersion().isAtLeast(JSFVersion.JSF_2_2)) { return problems; } CompilationInfo info = ctx.getCompilationInfo(); for (TypeElement typeElement : info.getTopLevelElements()) { for (AnnotationMirror annotationMirror : typeElement.getAnnotationMirrors()) { if (annotationMirror.getAnnotationType().toString().startsWith(JAVAX_FACES_BEAN)) { // it's javax.faces.bean annotation Tree tree = info.getTrees().getTree(typeElement, annotationMirror); List<Fix> fixes = getFixesForType(info, typeElement, annotationMirror); problems.add(JsfHintsUtils.createProblem( tree, info, Bundle.JavaxFacesBeanIsGonnaBeDeprecated_display_name(), Severity.HINT, fixes)); } } } return problems; }
@TriggerTreeKind(Tree.Kind.CLASS) @Messages("ERR_CreateTestClassHint=Create Test Class") public static ErrorDescription computeWarning(HintContext context) {
@TriggerTreeKind(Tree.Kind.METHOD) @Messages("ERR_CreateTestMethodsHint=Generate All Test Methods") public static ErrorDescription computeWarning(HintContext context) {
@TriggerTreeKind({Kind.MEMBER_SELECT, Kind.IDENTIFIER}) public static List<ErrorDescription> run(HintContext context) { CompilationInfo info = context.getInfo();