src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java

Print this page

        

@@ -688,14 +688,16 @@
 
         while(unmatchedAnnotations.size() > 0 && psi.hasNext() ) {
             ProcessorState ps = psi.next();
             Set<String>  matchedNames = new HashSet<String>();
             Set<TypeElement> typeElements = new LinkedHashSet<TypeElement>();
-            for (String unmatchedAnnotationName : unmatchedAnnotations.keySet()) {
+
+            for (Map.Entry<String, TypeElement> entry: unmatchedAnnotations.entrySet()) {
+                String unmatchedAnnotationName = entry.getKey();
                 if (ps.annotationSupported(unmatchedAnnotationName) ) {
                     matchedNames.add(unmatchedAnnotationName);
-                    TypeElement te = unmatchedAnnotations.get(unmatchedAnnotationName);
+                    TypeElement te = entry.getValue();
                     if (te != null)
                         typeElements.add(te);
                 }
             }
 

@@ -1216,11 +1218,11 @@
         }
 
         return false;
     }
 
-    private class AnnotationCollector extends TreeScanner {
+    private static class AnnotationCollector extends TreeScanner {
         List<JCTree> path = List.nil();
         static final boolean verbose = false;
         List<JCAnnotation> annotations = List.nil();
 
         public List<JCAnnotation> findAnnotations(List<? extends JCTree> nodes) {