langtools/src/share/classes/com/sun/tools/javac/code/Types.java
changeset 7331 02ffc087c654
parent 7204 0960f7e5e366
child 7627 de2a86da165e
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Thu Nov 18 16:13:11 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Tue Nov 23 11:08:43 2010 +0000
@@ -2772,6 +2772,8 @@
     public Type glb(Type t, Type s) {
         if (s == null)
             return t;
+        else if (t.isPrimitive() || s.isPrimitive())
+            return syms.errType;
         else if (isSubtypeNoCapture(t, s))
             return t;
         else if (isSubtypeNoCapture(s, t))
@@ -2928,6 +2930,15 @@
     }
 
     /**
+     * Return the boxed type if 't' is primitive, otherwise return 't' itself.
+     */
+    public Type boxedTypeOrType(Type t) {
+        return t.isPrimitive() ?
+            boxedClass(t).type :
+            t;
+    }
+
+    /**
      * Return the primitive type corresponding to a boxed type.
      */
     public Type unboxedType(Type t) {