changeset 1744:950901425da4

Reset the Annotations instance to allow setting the attributes.
author wmdietl
date Thu, 06 Sep 2012 00:36:40 -0700
parents 151d02b5671b
children 80876d4d3f75
files src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java	Thu Sep 06 00:35:57 2012 -0700
+++ b/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java	Thu Sep 06 00:36:40 2012 -0700
@@ -183,7 +183,6 @@
                     pos.pos = tree.pos;
                     separateAnnotationsKinds(tree.vartype, tree.sym.type, tree.sym, pos);*/
                 }
-
             }
             super.visitVarDef(tree);
         }
@@ -485,7 +484,7 @@
                 case MEMBER_SELECT: {
                     int index = 0;
                     List<JCTree> newPath = path.tail;
-                    JCTree npHead = null;
+                    JCTree npHead;
                     while (true) {
                         npHead = newPath.tail.head;
                         if (npHead.hasTag(JCTree.Tag.SELECT)) {
@@ -497,7 +496,7 @@
                             newPath = newPath.tail;
                         } else if (npHead.hasTag(JCTree.Tag.TYPEAPPLY)) {
                             JCTypeApply apply = (JCTypeApply) npHead;
-                            if( apply.arguments.contains(newPath.head)) {
+                            if (apply.arguments.contains(newPath.head)) {
                                 break;
                             } else {
                                 // Skip over parameterized types on the same level
@@ -817,6 +816,7 @@
             }
         }
 
+	sym.annotations.reset();
         sym.annotations.setAttributes(declAnnos.toList());
         List<TypeCompound> typeAnnotations = typeAnnos.toList();