I suspect a source-formatter bug when a record component is annotated and its value element is an array type.
Using spring-javaformat-maven-plugin:0.0.47, the code is formatted as:
public record SomeRecord(@SomeAnnot( {
"v1", "v2" }) String elt){
}
Checkstyle then reports two violations:
- SpringParenPad - whitespace before the annotation array element.
- WhitespaceAround - missing whitespace between the closing parenthesis of the record declaration and the record opening brace.
Expected formatting (similar to an annotation on a method parameter):
public record SomeRecord(@SomeAnnot({ "v1", "v2" }) String elt) {
}
I suspect a source-formatter bug when a record component is annotated and its value element is an array type.
Using spring-javaformat-maven-plugin:0.0.47, the code is formatted as:
Checkstyle then reports two violations:
Expected formatting (similar to an annotation on a method parameter):