langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
changeset 18010 604faee85350
parent 17557 9c6ace1881fe
child 18414 ee1e93e83d2b
--- 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);
         }