changeset 2407:6d7aa0b05158

Ensure type annotations are annotated before usage.
author wmdietl
date Thu, 11 Apr 2013 00:52:01 -0700
parents 19b1447640cd
children b5b61f27d93b
files src/share/classes/com/sun/tools/javac/comp/MemberEnter.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Thu Apr 11 00:51:14 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Thu Apr 11 00:52:01 2013 -0700
@@ -616,6 +616,9 @@
             if (TreeInfo.isEnumInit(tree)) {
                 attr.attribIdentAsEnumType(localEnv, (JCIdent)tree.vartype);
             } else {
+                // Make sure type annotations are processed.
+                // But we don't have a symbol to attach them to yet - use null.
+                typeAnnotate(tree.vartype, env, null);
                 attr.attribType(tree.vartype, localEnv);
             }
         } finally {
@@ -650,7 +653,7 @@
             enclScope.enter(v);
         }
         annotateLater(tree.mods.annotations, localEnv, v);
-        typeAnnotate(tree.vartype, env, tree.sym);
+        typeAnnotate(tree.vartype, env, v);
         annotate.flush();
         v.pos = tree.pos;
     }