--- old/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java 2010-03-02 14:04:59.000000000 -0800 +++ new/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java 2010-03-02 14:04:59.000000000 -0800 @@ -799,9 +799,6 @@ PrintWriter xout = context.get(Log.outKey); TaskListener taskListener = context.get(TaskListener.class); - - AnnotationCollector collector = new AnnotationCollector(); - JavaCompiler compiler = JavaCompiler.instance(context); compiler.todo.clear(); // free the compiler's resources @@ -1220,45 +1217,6 @@ return false; } - private static class AnnotationCollector extends TreeScanner { - List path = List.nil(); - static final boolean verbose = false; - List annotations = List.nil(); - - public List findAnnotations(List nodes) { - annotations = List.nil(); - scan(nodes); - List found = annotations; - annotations = List.nil(); - return found.reverse(); - } - - public void scan(JCTree node) { - if (node == null) - return; - Symbol sym = TreeInfo.symbolFor(node); - if (sym != null) - path = path.prepend(node); - super.scan(node); - if (sym != null) - path = path.tail; - } - - public void visitAnnotation(JCAnnotation node) { - annotations = annotations.prepend(node); - if (verbose) { - StringBuilder sb = new StringBuilder(); - for (JCTree tree : path.reverse()) { - System.err.print(sb); - System.err.println(TreeInfo.symbolFor(tree)); - sb.append(" "); - } - System.err.print(sb); - System.err.println(node); - } - } - } - private static List cleanTrees(List nodes) { for (T node : nodes) treeCleaner.scan(node);