8320200: Use Elements predicates for record constructors to improve print output
Reviewed-by: vromero
This commit is contained in:
parent
4fb5c12813
commit
ac07355f55
@ -155,14 +155,25 @@ public class PrintingProcessor extends AbstractProcessor {
|
||||
break;
|
||||
}
|
||||
|
||||
writer.print("(");
|
||||
printParameters(e);
|
||||
writer.print(")");
|
||||
AnnotationValue defaultValue = e.getDefaultValue();
|
||||
if (defaultValue != null)
|
||||
writer.print(" default " + defaultValue);
|
||||
if (elementUtils.isCompactConstructor(e)) {
|
||||
// A record's compact constructor by definition
|
||||
// lacks source-explicit parameters and lacks a
|
||||
// throws clause.
|
||||
writer.print(" {} /* compact constructor */ ");
|
||||
} else {
|
||||
writer.print("(");
|
||||
printParameters(e);
|
||||
writer.print(")");
|
||||
|
||||
// Display any default values for an annotation
|
||||
// interface element
|
||||
AnnotationValue defaultValue = e.getDefaultValue();
|
||||
if (defaultValue != null)
|
||||
writer.print(" default " + defaultValue);
|
||||
|
||||
printThrows(e);
|
||||
}
|
||||
|
||||
printThrows(e);
|
||||
writer.println(";");
|
||||
}
|
||||
return this;
|
||||
|
Loading…
x
Reference in New Issue
Block a user