--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java Wed Nov 04 12:27:00 2015 +0100
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java Thu Nov 05 11:32:01 2015 +0000
@@ -583,11 +583,13 @@
return false;
}
+ /**
+ * A compound type is a special class type whose supertypes are used to store a list
+ * of component types. There are two kinds of compound types: (i) intersection types
+ * {@see IntersectionClassType} and (ii) union types {@see UnionClassType}.
+ */
public boolean isCompound() {
- // Compound types can't have a (non-terminal) completer. Calling
- // flags() will complete the symbol causing the compiler to load
- // classes unnecessarily. This led to regression 6180021.
- return tsym.isCompleted() && (tsym.flags() & COMPOUND) != 0;
+ return false;
}
public boolean isIntersection() {
@@ -1200,6 +1202,11 @@
return true;
}
+ @Override
+ public boolean isCompound() {
+ return getLub().isCompound();
+ }
+
@Override @DefinedBy(Api.LANGUAGE_MODEL)
public TypeKind getKind() {
return TypeKind.UNION;
@@ -1242,6 +1249,11 @@
return Collections.unmodifiableList(getExplicitComponents());
}
+ @Override
+ public boolean isCompound() {
+ return true;
+ }
+
public List<Type> getComponents() {
return interfaces_field.prepend(supertype_field);
}