src/share/classes/com/sun/tools/javac/code/Types.java

changeset 779
5ef88773462b
parent 753
2536dedd897e
child 780
1d625fbe6c22
     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Types.java	Wed Dec 08 21:21:42 2010 -0800
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Thu Dec 09 15:50:10 2010 +0000
     1.3 @@ -1033,12 +1033,7 @@
     1.4                                  && !disjointTypes(aHigh.allparams(), lowSub.allparams())
     1.5                                  && !disjointTypes(aLow.allparams(), highSub.allparams())
     1.6                                  && !disjointTypes(aLow.allparams(), lowSub.allparams())) {
     1.7 -                                if (s.isInterface() &&
     1.8 -                                        !t.isInterface() &&
     1.9 -                                        t.isFinal() &&
    1.10 -                                        !isSubtype(t, s)) {
    1.11 -                                    return false;
    1.12 -                                } else if (upcast ? giveWarning(a, b) :
    1.13 +                                if (upcast ? giveWarning(a, b) :
    1.14                                      giveWarning(b, a))
    1.15                                      warnStack.head.warnUnchecked();
    1.16                                  return true;
    1.17 @@ -3377,8 +3372,8 @@
    1.18          public Type visitCapturedType(CapturedType t, Void s) {
    1.19              Type bound = visitWildcardType(t.wildcard, null);
    1.20              return (bound.contains(t)) ?
    1.21 -                    (high ? syms.objectType : syms.botType) :
    1.22 -                        bound;
    1.23 +                    erasure(bound) :
    1.24 +                    bound;
    1.25          }
    1.26  
    1.27          @Override
    1.28 @@ -3386,7 +3381,7 @@
    1.29              if (rewriteTypeVars) {
    1.30                  Type bound = high ?
    1.31                      (t.bound.contains(t) ?
    1.32 -                        syms.objectType :
    1.33 +                        erasure(t.bound) :
    1.34                          visit(t.bound)) :
    1.35                      syms.botType;
    1.36                  return rewriteAsWildcardType(bound, t);

mercurial