--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java Fri Feb 20 17:05:13 2015 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java Mon Feb 23 13:02:37 2015 +0000
@@ -477,6 +477,14 @@
&& (tsym.flags() & COMPOUND) != 0;
}
+ public boolean isIntersection() {
+ return false;
+ }
+
+ public boolean isUnion() {
+ return false;
+ }
+
public boolean isInterface() {
return (tsym.flags() & INTERFACE) != 0;
}
@@ -1079,6 +1087,11 @@
return Collections.unmodifiableList(alternatives_field);
}
+ @Override
+ public boolean isUnion() {
+ return true;
+ }
+
@Override @DefinedBy(Api.LANGUAGE_MODEL)
public TypeKind getKind() {
return TypeKind.UNION;
@@ -1125,6 +1138,11 @@
return interfaces_field.prepend(supertype_field);
}
+ @Override
+ public boolean isIntersection() {
+ return true;
+ }
+
public List<Type> getExplicitComponents() {
return allInterfaces ?
interfaces_field :