langtools/src/share/classes/com/sun/tools/javac/code/Types.java
changeset 14048 308d1cf8fe46
parent 13689 4d519199a6aa
child 14057 b4b0377b8dba
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Tue Sep 25 11:55:34 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Tue Sep 25 11:56:46 2012 +0100
@@ -34,6 +34,7 @@
 import com.sun.tools.javac.jvm.ClassReader;
 import com.sun.tools.javac.code.Attribute.RetentionPolicy;
 import com.sun.tools.javac.code.Lint.LintCategory;
+import com.sun.tools.javac.code.Type.UndetVar.InferenceBound;
 import com.sun.tools.javac.comp.Check;
 
 import static com.sun.tools.javac.code.Scope.*;
@@ -510,7 +511,7 @@
                     return false;
                 }
 
-                t.hibounds = t.hibounds.prepend(s);
+                t.addBound(InferenceBound.UPPER, s, Types.this);
                 return true;
             }
 
@@ -578,7 +579,7 @@
                 undet.qtype == s ||
                 s.tag == ERROR ||
                 s.tag == BOT) return true;
-            undet.lobounds = undet.lobounds.prepend(s);
+            undet.addBound(InferenceBound.LOWER, s, this);
             return true;
         }
         default:
@@ -723,7 +724,7 @@
                 if (t == s || t.qtype == s || s.tag == ERROR || s.tag == UNKNOWN)
                     return true;
 
-                t.eq = t.eq.prepend(s);
+                t.addBound(InferenceBound.EQ, s, Types.this);
 
                 return true;
             }
@@ -735,19 +736,6 @@
         };
     // </editor-fold>
 
-    // <editor-fold defaultstate="collapsed" desc="fromUnknownFun">
-    /**
-     * A mapping that turns all unknown types in this type to fresh
-     * unknown variables.
-     */
-    public Mapping fromUnknownFun = new Mapping("fromUnknownFun") {
-            public Type apply(Type t) {
-                if (t.tag == UNKNOWN) return new UndetVar(t);
-                else return t.map(this);
-            }
-        };
-    // </editor-fold>
-
     // <editor-fold defaultstate="collapsed" desc="Contains Type">
     public boolean containedBy(Type t, Type s) {
         switch (t.tag) {
@@ -759,12 +747,12 @@
                     case UNBOUND: //similar to ? extends Object
                     case EXTENDS: {
                         Type bound = upperBound(s);
-                        undetvar.hibounds = undetvar.hibounds.prepend(bound);
+                        undetvar.addBound(InferenceBound.UPPER, bound, this);
                         break;
                     }
                     case SUPER: {
                         Type bound = lowerBound(s);
-                        undetvar.lobounds = undetvar.lobounds.prepend(bound);
+                        undetvar.addBound(InferenceBound.LOWER, bound, this);
                         break;
                     }
                 }