Apache NetBeans version
Apache NetBeans 28
What happened
Pressing Enter after a parameter in the parameter list of a nested record class indents the next line incorrectly, as if the record class was one nesting level higher than it actuall is.
Language / Project Type / NetBeans Component
Java, Editor
How to reproduce
Example:
class Example
{
class Nested
{
private record ExampleRecord(
ProcessHandle processHandle, ThreadGroup threadGroup)
{
// ...
}
}
}
Pressing Enter after the comma results in:
class Example
{
class Nested
{
private record ExampleRecord(
ProcessHandle processHandle,
ThreadGroup threadGroup)
{
// ...
}
}
}
Whereas the expected result would be:
class Example
{
class Nested
{
record ExampleRecord(
ProcessHandle processHandle,
ThreadGroup threadGroup)
{
// ...
}
}
}
The Nested class is just to illustrate that the resulting indentation level is exactly 1 level too high. The incorrect behavior also happens with one nesting level less.
Did this work correctly in an earlier version?
No / Don't know
Operating System
Windows
JDK
JDK 21
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
The generated indentation is correct when the record class is a top-level class. It's only for nested record classes that the indentation level is wrong.
Are you willing to submit a pull request?
No
Apache NetBeans version
Apache NetBeans 28
What happened
Pressing Enter after a parameter in the parameter list of a nested record class indents the next line incorrectly, as if the record class was one nesting level higher than it actuall is.
Language / Project Type / NetBeans Component
Java, Editor
How to reproduce
Example:
Pressing Enter after the comma results in:
Whereas the expected result would be:
The
Nestedclass is just to illustrate that the resulting indentation level is exactly 1 level too high. The incorrect behavior also happens with one nesting level less.Did this work correctly in an earlier version?
No / Don't know
Operating System
Windows
JDK
JDK 21
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
The generated indentation is correct when the record class is a top-level class. It's only for nested record classes that the indentation level is wrong.
Are you willing to submit a pull request?
No