langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java
changeset 18643 fdd7572e0c18
parent 18389 a425d0819f36
child 18909 8f9fc5d876e4
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Wed Jun 19 22:07:05 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Thu Jun 20 08:45:43 2013 +0100
@@ -109,15 +109,20 @@
         source = Source.instance(context);
         target = Target.instance(context);
         deferredLintHandler = DeferredLintHandler.instance(context);
+        allowTypeAnnos = source.allowTypeAnnotations();
     }
 
+    /** Switch: support type annotations.
+     */
+    boolean allowTypeAnnos;
+
     /** A queue for classes whose members still need to be entered into the
      *  symbol table.
      */
     ListBuffer<Env<AttrContext>> halfcompleted = new ListBuffer<Env<AttrContext>>();
 
     /** Set to true only when the first of a set of classes is
-     *  processed from the halfcompleted queue.
+     *  processed from the half completed queue.
      */
     boolean isFirst = true;
 
@@ -1072,7 +1077,9 @@
                 isFirst = true;
             }
         }
-        TypeAnnotations.organizeTypeAnnotationsSignatures(syms, names, log, tree, annotate);
+        if (allowTypeAnnos) {
+            TypeAnnotations.organizeTypeAnnotationsSignatures(syms, names, log, tree, annotate);
+        }
     }
 
     /*
@@ -1117,7 +1124,9 @@
     }
 
     public void typeAnnotate(final JCTree tree, final Env<AttrContext> env, final Symbol sym) {
-        tree.accept(new TypeAnnotate(env, sym));
+        if (allowTypeAnnos) {
+            tree.accept(new TypeAnnotate(env, sym));
+        }
     }
 
     /**