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

changeset 1251
6f0ed5a89c25
parent 1177
70d92518063e
child 1307
464f52f59f7d
     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Types.java	Tue Apr 10 23:19:26 2012 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Wed Apr 11 10:50:11 2012 +0100
     1.3 @@ -326,11 +326,6 @@
     1.4              else if (t.tag == TYPEVAR) {
     1.5                  return isSubtypeUnchecked(t.getUpperBound(), s, warn);
     1.6              }
     1.7 -            else if (s.tag == UNDETVAR) {
     1.8 -                UndetVar uv = (UndetVar)s;
     1.9 -                if (uv.inst != null)
    1.10 -                    return isSubtypeUnchecked(t, uv.inst, warn);
    1.11 -            }
    1.12              else if (!s.isRaw()) {
    1.13                  Type t2 = asSuper(t, s.tsym);
    1.14                  if (t2 != null && t2.isRaw()) {
    1.15 @@ -515,9 +510,6 @@
    1.16                      return false;
    1.17                  }
    1.18  
    1.19 -                if (t.inst != null)
    1.20 -                    return isSubtypeNoCapture(t.inst, s); // TODO: ", warn"?
    1.21 -
    1.22                  t.hibounds = t.hibounds.prepend(s);
    1.23                  return true;
    1.24              }
    1.25 @@ -586,8 +578,6 @@
    1.26                  undet.qtype == s ||
    1.27                  s.tag == ERROR ||
    1.28                  s.tag == BOT) return true;
    1.29 -            if (undet.inst != null)
    1.30 -                return isSubtype(s, undet.inst);
    1.31              undet.lobounds = undet.lobounds.prepend(s);
    1.32              return true;
    1.33          }
    1.34 @@ -733,18 +723,8 @@
    1.35                  if (t == s || t.qtype == s || s.tag == ERROR || s.tag == UNKNOWN)
    1.36                      return true;
    1.37  
    1.38 -                if (t.inst != null)
    1.39 -                    return visit(t.inst, s);
    1.40 -
    1.41 -                t.inst = fromUnknownFun.apply(s);
    1.42 -                for (List<Type> l = t.lobounds; l.nonEmpty(); l = l.tail) {
    1.43 -                    if (!isSubtype(l.head, t.inst))
    1.44 -                        return false;
    1.45 -                }
    1.46 -                for (List<Type> l = t.hibounds; l.nonEmpty(); l = l.tail) {
    1.47 -                    if (!isSubtype(t.inst, l.head))
    1.48 -                        return false;
    1.49 -                }
    1.50 +                t.eq = t.eq.prepend(s);
    1.51 +
    1.52                  return true;
    1.53              }
    1.54  
    1.55 @@ -779,23 +759,11 @@
    1.56                      case UNBOUND: //similar to ? extends Object
    1.57                      case EXTENDS: {
    1.58                          Type bound = upperBound(s);
    1.59 -                        // We should check the new upper bound against any of the
    1.60 -                        // undetvar's lower bounds.
    1.61 -                        for (Type t2 : undetvar.lobounds) {
    1.62 -                            if (!isSubtype(t2, bound))
    1.63 -                                return false;
    1.64 -                        }
    1.65                          undetvar.hibounds = undetvar.hibounds.prepend(bound);
    1.66                          break;
    1.67                      }
    1.68                      case SUPER: {
    1.69                          Type bound = lowerBound(s);
    1.70 -                        // We should check the new lower bound against any of the
    1.71 -                        // undetvar's lower bounds.
    1.72 -                        for (Type t2 : undetvar.hibounds) {
    1.73 -                            if (!isSubtype(bound, t2))
    1.74 -                                return false;
    1.75 -                        }
    1.76                          undetvar.lobounds = undetvar.lobounds.prepend(bound);
    1.77                          break;
    1.78                      }

mercurial