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.
Any generated code will not have its braces set correctly, including unit test code. @Test public void square() { System.out.println("square"); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
Could you please describe the steps that lead to this problem? Please note that the formatting options are not applied when you create a new file from a template. There is another defect filed for this. Is this your case? Thanks
I go into Tool/Options, then Advanced Options and in the tree I set Editing/Editor Settings/Java Editor and I set the property for Indentation Engine to Java Indentation Engine. Then I click on the "..." next to that and I get the Java Editor - Indentation Engine dialog. This is where I set the Add Newline Before Brace. When I select a function and then select the Source/Format menu on the menu bar, the source does not format with the brace on the next line. If I don't select any code and open a file that does not have a newline before braces, and select Source/Format from the menu bar, the braces don't move to the next line. When I Create JUnit Tests, the code is not formatted correctly. I'm not sure if the unit test generation uses a template or not. I hope this helps.
Now I see. Since NetBeans 6.0, the 'Tools -> Options -> Advanced Options -> ... -> Java Indentation Engine' should not be used to specify Java formatting options. It is obsolete and should be removed (see issue #121124). Please use 'Tools -> Options -> Java Code -> Formatting -> Alignment and Braces -> Braces Placement' instead. Thanks. *** This issue has been marked as a duplicate of 121124 ***