langtools/src/share/classes/com/sun/tools/javac/code/Types.java
changeset 2218 a8ec0baae870
parent 1993 9b37ef07ba64
child 2221 cd6557bcaa0a
equal deleted inserted replaced
2217:120470d1e00d 2218:a8ec0baae870
  1008                                 : a.tsym + " != " + highSub.tsym + " != " + lowSub.tsym;
  1008                                 : a.tsym + " != " + highSub.tsym + " != " + lowSub.tsym;
  1009                             if (!disjointTypes(aHigh.allparams(), highSub.allparams())
  1009                             if (!disjointTypes(aHigh.allparams(), highSub.allparams())
  1010                                 && !disjointTypes(aHigh.allparams(), lowSub.allparams())
  1010                                 && !disjointTypes(aHigh.allparams(), lowSub.allparams())
  1011                                 && !disjointTypes(aLow.allparams(), highSub.allparams())
  1011                                 && !disjointTypes(aLow.allparams(), highSub.allparams())
  1012                                 && !disjointTypes(aLow.allparams(), lowSub.allparams())) {
  1012                                 && !disjointTypes(aLow.allparams(), lowSub.allparams())) {
  1013                                 if (upcast ? giveWarning(a, highSub) || giveWarning(a, lowSub)
  1013                                 if (upcast ? giveWarning(a, b) :
  1014                                            : giveWarning(highSub, a) || giveWarning(lowSub, a))
  1014                                     giveWarning(b, a))
  1015                                     warnStack.head.warnUnchecked();
  1015                                     warnStack.head.warnUnchecked();
  1016                                 return true;
  1016                                 return true;
  1017                             }
  1017                             }
  1018                         }
  1018                         }
  1019                         if (isReifiable(s))
  1019                         if (isReifiable(s))
  3222             warn.warnUnchecked();
  3222             warn.warnUnchecked();
  3223         return true;
  3223         return true;
  3224     }
  3224     }
  3225 
  3225 
  3226     private boolean giveWarning(Type from, Type to) {
  3226     private boolean giveWarning(Type from, Type to) {
  3227         // To and from are (possibly different) parameterizations
  3227         Type subFrom = asSub(from, to.tsym);
  3228         // of the same class or interface
  3228         return to.isParameterized() &&
  3229         return to.isParameterized() && !containsType(to.allparams(), from.allparams());
  3229                 (!(isUnbounded(to) ||
       
  3230                 isSubtype(from, to) ||
       
  3231                 ((subFrom != null) && isSameType(subFrom, to))));
  3230     }
  3232     }
  3231 
  3233 
  3232     private List<Type> superClosure(Type t, Type s) {
  3234     private List<Type> superClosure(Type t, Type s) {
  3233         List<Type> cl = List.nil();
  3235         List<Type> cl = List.nil();
  3234         for (List<Type> l = interfaces(t); l.nonEmpty(); l = l.tail) {
  3236         for (List<Type> l = interfaces(t); l.nonEmpty(); l = l.tail) {