From 7c5edd537310dd800bb9b7a3ffa715075d911313 Mon Sep 17 00:00:00 2001 From: darcy Date: Tue, 2 Mar 2010 14:06:47 -0800 Subject: [PATCH] 6931130: Remove unused AnnotationCollector code from JavacProcessingEnvironment Reviewed-by: jjg --- .../JavacProcessingEnvironment.java | 42 ------------------- 1 file changed, 42 deletions(-) diff --git a/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java b/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java index 7ce03d37..938b3e60 100644 --- a/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java +++ b/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java @@ -799,9 +799,6 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea 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 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea 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); -- GitLab