diff -r 9b26c96f5138 -r f6f1fd261f57 src/share/classes/com/sun/tools/javac/code/Type.java --- a/src/share/classes/com/sun/tools/javac/code/Type.java Fri Nov 30 15:14:36 2012 +0000 +++ b/src/share/classes/com/sun/tools/javac/code/Type.java Fri Nov 30 15:14:48 2012 +0000 @@ -839,6 +839,49 @@ } } + // a clone of a ClassType that knows about the bounds of an intersection type. + public static class IntersectionClassType extends ClassType implements IntersectionType { + + public boolean allInterfaces; + + public enum IntersectionKind { + EXPLICIT, + IMPLICT; + } + + public IntersectionKind intersectionKind; + + public IntersectionClassType(List bounds, ClassSymbol csym, boolean allInterfaces) { + super(Type.noType, List.nil(), csym); + this.allInterfaces = allInterfaces; + Assert.check((csym.flags() & COMPOUND) != 0); + supertype_field = bounds.head; + interfaces_field = bounds.tail; + Assert.check(supertype_field.tsym.completer != null || + !supertype_field.isInterface(), supertype_field); + } + + public java.util.List getBounds() { + return Collections.unmodifiableList(getComponents()); + } + + public List getComponents() { + return interfaces_field.prepend(supertype_field); + } + + @Override + public TypeKind getKind() { + return TypeKind.INTERSECTION; + } + + @Override + public R accept(TypeVisitor v, P p) { + return intersectionKind == IntersectionKind.EXPLICIT ? + v.visitIntersection(this, p) : + v.visitDeclared(this, p); + } + } + public static class ArrayType extends Type implements javax.lang.model.type.ArrayType {