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

Print this page

        

@@ -419,10 +419,18 @@
             // compiler to load classes unnecessarily.  This led
             // to regression 6180021.
             && (tsym.flags() & COMPOUND) != 0;
     }
 
+    public boolean isIntersection() {
+        return false;
+    }
+
+    public boolean isUnion() {
+        return false;
+    }
+
     public boolean isInterface() {
         return (tsym.flags() & INTERFACE) != 0;
     }
 
     public boolean isFinal() {

@@ -968,10 +976,15 @@
         public java.util.List<? extends TypeMirror> getAlternatives() {
             return Collections.unmodifiableList(alternatives_field);
         }
 
         @Override
+        public boolean isUnion() {
+            return true;
+        }
+
+        @Override
         public TypeKind getKind() {
             return TypeKind.UNION;
         }
 
         @Override

@@ -1001,10 +1014,15 @@
 
         public List<Type> getComponents() {
             return interfaces_field.prepend(supertype_field);
         }
 
+        @Override
+        public boolean isIntersection() {
+            return true;
+        }
+
         public List<Type> getExplicitComponents() {
             return allInterfaces ?
                     interfaces_field :
                     getComponents();
         }