This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
In certain situations, when braces placement is configured to "New Line", NetBeans determines an incorrect indentation level. Example ("<caret>" indicates the position of the caret): class Test { protected class Inner { private final Object test = new Object() { private void test() { if ("test" != null) <caret> } }; } @Override public String toString() { return super.toString(); } } Typing "{" incorrectly results in: class Test { protected class Inner { private final Object test = new Object() { private void test() { if ("test" != null) {<caret> } }; } @Override public String toString() { return super.toString(); } } The expected result would be: class Test { protected class Inner { private final Object test = new Object() { private void test() { if ("test" != null) {<caret> } }; } @Override public String toString() { return super.toString(); } } Strangely, the error occurs only when the toString() method declaration is present.
Seems to work OK in the trunk version; in my editor, the opening curly brace appeared aligned with the if- statement. Please export your formatting options for java and attach them.
Please try with Continuation Indentation Size set to 4. The faulty behavior doen't happen when it is set to 8, which I believe is the default, but I have it set to 4.
Great, reproduced.