langtools/src/share/classes/com/sun/tools/javac/code/Types.java
changeset 21041 99f5e5e97425
parent 20608 5cc020154cff
child 21712 d363f367d4c0
equal deleted inserted replaced
21040:3e32f68d2151 21041:99f5e5e97425
  1271                     return false;
  1271                     return false;
  1272                 if (!t.getAnnotationMirrors().containsAll(s.getAnnotationMirrors()))
  1272                 if (!t.getAnnotationMirrors().containsAll(s.getAnnotationMirrors()))
  1273                     return false;
  1273                     return false;
  1274                 if (!s.getAnnotationMirrors().containsAll(t.getAnnotationMirrors()))
  1274                 if (!s.getAnnotationMirrors().containsAll(t.getAnnotationMirrors()))
  1275                     return false;
  1275                     return false;
  1276                 return visit(t.underlyingType, s);
  1276                 return visit(t.unannotatedType(), s);
  1277             }
  1277             }
  1278         };
  1278         };
  1279     // </editor-fold>
  1279     // </editor-fold>
  1280 
  1280 
  1281     // <editor-fold defaultstate="collapsed" desc="Contains Type">
  1281     // <editor-fold defaultstate="collapsed" desc="Contains Type">
  2215                 return t;
  2215                 return t;
  2216             }
  2216             }
  2217 
  2217 
  2218             @Override
  2218             @Override
  2219             public Type visitAnnotatedType(AnnotatedType t, Boolean recurse) {
  2219             public Type visitAnnotatedType(AnnotatedType t, Boolean recurse) {
  2220                 Type erased = erasure(t.underlyingType, recurse);
  2220                 Type erased = erasure(t.unannotatedType(), recurse);
  2221                 if (erased.isAnnotated()) {
  2221                 if (erased.isAnnotated()) {
  2222                     // This can only happen when the underlying type is a
  2222                     // This can only happen when the underlying type is a
  2223                     // type variable and the upper bound of it is annotated.
  2223                     // type variable and the upper bound of it is annotated.
  2224                     // The annotation on the type variable overrides the one
  2224                     // The annotation on the type variable overrides the one
  2225                     // on the bound.
  2225                     // on the bound.
  2226                     erased = ((AnnotatedType)erased).underlyingType;
  2226                     erased = ((AnnotatedType)erased).unannotatedType();
  2227                 }
  2227                 }
  2228                 return new AnnotatedType(t.typeAnnotations, erased);
  2228                 return erased.annotatedType(t.getAnnotationMirrors());
  2229             }
  2229             }
  2230         };
  2230         };
  2231 
  2231 
  2232     private Mapping erasureFun = new Mapping ("erasure") {
  2232     private Mapping erasureFun = new Mapping ("erasure") {
  2233             public Type apply(Type t) { return erasure(t); }
  2233             public Type apply(Type t) { return erasure(t); }
  4417         public R visitCapturedType(CapturedType t, S s) { return visitType(t, s); }
  4417         public R visitCapturedType(CapturedType t, S s) { return visitType(t, s); }
  4418         public R visitForAll(ForAll t, S s)             { return visitType(t, s); }
  4418         public R visitForAll(ForAll t, S s)             { return visitType(t, s); }
  4419         public R visitUndetVar(UndetVar t, S s)         { return visitType(t, s); }
  4419         public R visitUndetVar(UndetVar t, S s)         { return visitType(t, s); }
  4420         public R visitErrorType(ErrorType t, S s)       { return visitType(t, s); }
  4420         public R visitErrorType(ErrorType t, S s)       { return visitType(t, s); }
  4421         // Pretend annotations don't exist
  4421         // Pretend annotations don't exist
  4422         public R visitAnnotatedType(AnnotatedType t, S s) { return visit(t.underlyingType, s); }
  4422         public R visitAnnotatedType(AnnotatedType t, S s) { return visit(t.unannotatedType(), s); }
  4423     }
  4423     }
  4424 
  4424 
  4425     /**
  4425     /**
  4426      * A default visitor for symbols.  All visitor methods except
  4426      * A default visitor for symbols.  All visitor methods except
  4427      * visitSymbol are implemented by delegating to visitSymbol.  Concrete
  4427      * visitSymbol are implemented by delegating to visitSymbol.  Concrete