--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java Tue Jun 04 13:21:41 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java Tue Jun 04 14:17:50 2013 -0700
@@ -1131,6 +1131,14 @@
private static class TypeAnnotationFinder extends TreeScanner {
public boolean foundTypeAnno = false;
+
+ @Override
+ public void scan(JCTree tree) {
+ if (foundTypeAnno || tree == null)
+ return;
+ super.scan(tree);
+ }
+
public void visitAnnotation(JCAnnotation tree) {
foundTypeAnno = foundTypeAnno || tree.hasTag(TYPE_ANNOTATION);
}