-
Notifications
You must be signed in to change notification settings - Fork 160
Open
Description
Given the following records:
public record X(String a,
@SuppressWarnings({ "a", "b" }) String b) {
}
record Y(String c){
}and this formatter configuration
Then, if we format the above code we get the following:
public record X(String a,
@SuppressWarnings( { // <-- the space should not be inserted
"a", "b" }) String b){ // <-- the space should be inserted
}
record Y(String c) { // <-- this works just fine
}In record X, a space has been inserted between the opening bracket of the annotation and the opening brace, where the configuration says it should not. The space is removed, instead, between the closing bracket of the record field declaration and the opening brace of its body, where the configuration says it should insert a space.
In record Y, where there are no annotations, the formatter works as expected.
Eclipse Java Development Tools 3.20.300.v20250805-1800
Metadata
Metadata
Assignees
Labels
No labels