diff -r 3085d0089546 -r 4baab658f357 src/share/classes/com/sun/tools/javac/code/Type.java --- a/src/share/classes/com/sun/tools/javac/code/Type.java Wed Mar 02 21:06:17 2011 -0800 +++ b/src/share/classes/com/sun/tools/javac/code/Type.java Wed Mar 02 21:13:55 2011 -0800 @@ -93,6 +93,22 @@ return null; } + /** + * Get the representation of this type used for modelling purposes. + * By default, this is itself. For ErrorType, a different value + * may be provided, + */ + public Type getModelType() { + return this; + } + + public static List getModelTypes(List ts) { + ListBuffer lb = new ListBuffer(); + for (Type t: ts) + lb.append(t.getModelType()); + return lb.toList(); + } + public R accept(Type.Visitor v, S s) { return v.visitType(this, s); } /** Define a type given its tag and type symbol @@ -190,7 +206,7 @@ if (ts.isEmpty()) { return ""; } else { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(ts.head.toString()); for (List l = ts.tail; l.nonEmpty(); l = l.tail) buf.append(",").append(l.head.toString()); @@ -464,7 +480,7 @@ boolean isPrintingBound = false; public String toString() { - StringBuffer s = new StringBuffer(); + StringBuilder s = new StringBuilder(); s.append(kind.toString()); if (kind != UNBOUND) s.append(type); @@ -538,6 +554,10 @@ */ public List interfaces_field; + /** All the interfaces of this class, including missing ones. + */ + public List all_interfaces_field; + public ClassType(Type outer, List typarams, TypeSymbol tsym) { super(CLASS, tsym); this.outer_field = outer; @@ -578,7 +598,7 @@ /** The Java source which this type represents. */ public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (getEnclosingType().tag == CLASS && tsym.owner.kind == TYP) { buf.append(getEnclosingType().toString()); buf.append("."); @@ -596,7 +616,7 @@ //where private String className(Symbol sym, boolean longform) { if (sym.name.isEmpty() && (sym.flags() & COMPOUND) != 0) { - StringBuffer s = new StringBuffer(supertype_field.toString()); + StringBuilder s = new StringBuilder(supertype_field.toString()); for (List is=interfaces_field; is.nonEmpty(); is = is.tail) { s.append("&"); s.append(is.head.toString());