langtools/src/share/classes/com/sun/tools/javac/code/Types.java
changeset 21041 99f5e5e97425
parent 20608 5cc020154cff
child 21712 d363f367d4c0
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Tue Oct 15 22:15:35 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Tue Oct 15 15:57:13 2013 -0700
@@ -1273,7 +1273,7 @@
                     return false;
                 if (!s.getAnnotationMirrors().containsAll(t.getAnnotationMirrors()))
                     return false;
-                return visit(t.underlyingType, s);
+                return visit(t.unannotatedType(), s);
             }
         };
     // </editor-fold>
@@ -2217,15 +2217,15 @@
 
             @Override
             public Type visitAnnotatedType(AnnotatedType t, Boolean recurse) {
-                Type erased = erasure(t.underlyingType, recurse);
+                Type erased = erasure(t.unannotatedType(), recurse);
                 if (erased.isAnnotated()) {
                     // This can only happen when the underlying type is a
                     // type variable and the upper bound of it is annotated.
                     // The annotation on the type variable overrides the one
                     // on the bound.
-                    erased = ((AnnotatedType)erased).underlyingType;
+                    erased = ((AnnotatedType)erased).unannotatedType();
                 }
-                return new AnnotatedType(t.typeAnnotations, erased);
+                return erased.annotatedType(t.getAnnotationMirrors());
             }
         };
 
@@ -4419,7 +4419,7 @@
         public R visitUndetVar(UndetVar t, S s)         { return visitType(t, s); }
         public R visitErrorType(ErrorType t, S s)       { return visitType(t, s); }
         // Pretend annotations don't exist
-        public R visitAnnotatedType(AnnotatedType t, S s) { return visit(t.underlyingType, s); }
+        public R visitAnnotatedType(AnnotatedType t, S s) { return visit(t.unannotatedType(), s); }
     }
 
     /**