src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java

Print this page
rev 218 : 6460529: Provide mixin interfaces for getQualifiedName and getTypeParameters
Reviewed-by: jjg

*** 123,133 **** } }).visit(enclosing)) return this; defaultAction(e, true); ! printFormalTypeParameters(e); switch(kind) { case CONSTRUCTOR: // Print out simple name of the class writer.print(e.getEnclosingElement().getSimpleName()); --- 123,133 ---- } }).visit(enclosing)) return this; defaultAction(e, true); ! printFormalTypeParameters(e, true); switch(kind) { case CONSTRUCTOR: // Print out simple name of the class writer.print(e.getEnclosingElement().getSimpleName());
*** 205,215 **** writer.print(kind.toString().toLowerCase()); } writer.print(" "); writer.print(e.getSimpleName()); ! printFormalTypeParameters(e); // Print superclass information if informative if (kind == CLASS) { TypeMirror supertype = e.getSuperclass(); if (supertype.getKind() != TypeKind.NONE) { --- 205,215 ---- writer.print(kind.toString().toLowerCase()); } writer.print(" "); writer.print(e.getSimpleName()); ! printFormalTypeParameters(e, false); // Print superclass information if informative if (kind == CLASS) { TypeMirror supertype = e.getSuperclass(); if (supertype.getKind() != TypeKind.NONE) {
*** 362,381 **** for(Modifier m: modifiers) { writer.print(m.toString() + " "); } } ! private void printFormalTypeParameters(ExecutableElement executable) { ! printFormalTypeParameters(executable.getTypeParameters(), true); ! } ! ! private void printFormalTypeParameters(TypeElement type) { ! printFormalTypeParameters(type.getTypeParameters(), false); ! } ! ! private void printFormalTypeParameters(List<? extends TypeParameterElement> typeParams, boolean pad) { if (typeParams.size() > 0) { writer.print("<"); boolean first = true; for(TypeParameterElement tpe: typeParams) { --- 362,374 ---- for(Modifier m: modifiers) { writer.print(m.toString() + " "); } } ! private void printFormalTypeParameters(Parameterizable e, boolean pad) { + List<? extends TypeParameterElement> typeParams = e.getTypeParameters(); if (typeParams.size() > 0) { writer.print("<"); boolean first = true; for(TypeParameterElement tpe: typeParams) {