src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java
changeset 47458 945935416d7c
parent 47268 48ec75306997
child 47959 5dd899009525
equal deleted inserted replaced
47457:217860329f71 47458:945935416d7c
   290         }
   290         }
   291 
   291 
   292         @Override
   292         @Override
   293         public Type visitTypeVar(TypeVar t, ProjectionKind pkind) {
   293         public Type visitTypeVar(TypeVar t, ProjectionKind pkind) {
   294             if (vars.contains(t)) {
   294             if (vars.contains(t)) {
   295                 try {
   295                 if (seen.add(t)) {
   296                     if (seen.add(t)) {
   296                     try {
   297                         final Type bound;
   297                         final Type bound;
   298                         switch (pkind) {
   298                         switch (pkind) {
   299                             case UPWARDS:
   299                             case UPWARDS:
   300                                 bound = t.getUpperBound();
   300                                 bound = t.getUpperBound();
   301                                 break;
   301                                 break;
   307                             default:
   307                             default:
   308                                 Assert.error();
   308                                 Assert.error();
   309                                 return null;
   309                                 return null;
   310                         }
   310                         }
   311                         return bound.map(this, pkind);
   311                         return bound.map(this, pkind);
   312                     } else {
   312                     } finally {
   313                         //cycle
   313                         seen.remove(t);
   314                         return syms.objectType;
       
   315                     }
   314                     }
   316                 } finally {
   315                 } else {
   317                     seen.remove(t);
   316                     //cycle
       
   317                     return pkind == ProjectionKind.UPWARDS ?
       
   318                             syms.objectType : syms.botType;
   318                 }
   319                 }
   319             } else {
   320             } else {
   320                 return t;
   321                 return t;
   321             }
   322             }
   322         }
   323         }