netbeans
netbeans copied to clipboard
Java record formatting with annotation problem
Apache NetBeans version
Apache NetBeans 14
What happened
Whenever formating a record which using @JsonInclude, the formatting is not correct.
How to reproduce
Please try to format this:
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public record AccountBalance(
String id,
AccountType type,
String name,
String description,
AssetType assetType,
AccountUsage usage,
Currency currency,
BigDecimal balance,
BigDecimal openBalance,
OffsetDateTime openBalanceAt) {
}
Did this work correctly in an earlier version?
No
Operating System
Windows 11
JDK
Oracle JDK 18.0.1.1
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
It can be repeated everytime.
Are you willing to submit a pull request?
No
Code of Conduct
Yes
Please share the output and what you expect the output to be. Thanks.
For example, this is my record:
After right click -> Format
Expected:

fixed by #5374