Source:
<code>protected void checkQualifierParameter(ClassTree classTree) { Set<AnnotationMirror> illegalOnFieldsPolyQual = AnnotationUtils.createAnnotationSet(); Set<AnnotationMirror> polys = AnnotationUtils.createAnnotationSet(); for (AnnotationMirror top : atypeFactory.getQualifierHierarchy().getTopAnnotations()) { <START> TypeElement classElement = TreeUtils.elementFromDeclaration(classTree); <END> if (classElement == null) { continue; } AnnotationMirror poly = atypeFactory.getQualifierHierarchy().getPolymorphicAnnotation(top); if (poly != null) { polys.add(poly); } if (atypeFactory.hasExplicitQualifierParameterInHierarchy(classElement, top) && atypeFactory.hasExplicitNoQualifierParameterInHierarchy(classElement, top)) { checker.reportError(classTree, "conflicting.qual.param", top); } if (atypeFactory.hasQualifierParameterInHierarchy(classElement, top)) { continue; } if (poly != null) { illegalOnFieldsPolyQual.add(poly); } Element extendsEle = TypesUtils.getTypeElement(classElement.getSuperclass()); if (extendsEle != null && atypeFactory.hasQualifierParameterInHierarchy(extendsEle, top)) { checker.reportError(classTree, "missing.has.qual.param"); } else { for (TypeMirror interfaceType : classElement.getInterfaces()) { Element interfaceEle = TypesUtils.getTypeElement(interfaceType); if (atypeFactory.hasQualifierParameterInHierarchy(interfaceEle, top)) { checker.reportError(classTree, "missing.has.qual.param"); break; } } } } for (Tree mem : classTree.getMembers()) { if (mem.getKind() == Tree.Kind.VARIABLE) { AnnotatedTypeMirror fieldType = atypeFactory.getAnnotatedType(mem); List<DiagMessage> hasIllegalPoly; if (ElementUtils.isStatic(TreeUtils.elementFromDeclaration((VariableTree) mem))) { hasIllegalPoly = polyScanner.visit(fieldType, polys); } else { hasIllegalPoly = polyScanner.visit(fieldType, illegalOnFieldsPolyQual); } for (DiagMessage dm : hasIllegalPoly) { checker.report(mem, dm); } } } }</code><technical_language>is this code in loop? This depends classTree, top</technical_language>

Target:
protected void checkQualifierParameter(ClassTree classTree) { Set<AnnotationMirror> illegalOnFieldsPolyQual = AnnotationUtils.createAnnotationSet(); Set<AnnotationMirror> polys = AnnotationUtils.createAnnotationSet(); TypeElement classElement = TreeUtils.elementFromDeclaration(classTree); for (AnnotationMirror top : atypeFactory.getQualifierHierarchy().getTopAnnotations()) { AnnotationMirror poly = atypeFactory.getQualifierHierarchy().getPolymorphicAnnotation(top); if (poly != null) { polys.add(poly); } if (atypeFactory.hasExplicitQualifierParameterInHierarchy(classElement, top) && atypeFactory.hasExplicitNoQualifierParameterInHierarchy(classElement, top)) { checker.reportError(classTree, "conflicting.qual.param", top); } if (atypeFactory.hasQualifierParameterInHierarchy(classElement, top)) { continue; } if (poly != null) { illegalOnFieldsPolyQual.add(poly); } Element extendsEle = TypesUtils.getTypeElement(classElement.getSuperclass()); if (extendsEle != null && atypeFactory.hasQualifierParameterInHierarchy(extendsEle, top)) { checker.reportError(classTree, "missing.has.qual.param"); } else { for (TypeMirror interfaceType : classElement.getInterfaces()) { Element interfaceEle = TypesUtils.getTypeElement(interfaceType); if (atypeFactory.hasQualifierParameterInHierarchy(interfaceEle, top)) { checker.reportError(classTree, "missing.has.qual.param", top); break; } } } } for (Tree mem : classTree.getMembers()) { if (mem.getKind() == Tree.Kind.VARIABLE) { AnnotatedTypeMirror fieldType = atypeFactory.getAnnotatedType(mem); List<DiagMessage> hasIllegalPoly; if (ElementUtils.isStatic(TreeUtils.elementFromDeclaration((VariableTree) mem))) { hasIllegalPoly = polyScanner.visit(fieldType, polys); } else { hasIllegalPoly = polyScanner.visit(fieldType, illegalOnFieldsPolyQual); } for (DiagMessage dm : hasIllegalPoly) { checker.report(mem, dm); } } } }