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.

Bug 127024 - Add newline before brace does not work in java indentation enging
Summary: Add newline before brace does not work in java indentation enging
Status: RESOLVED DUPLICATE of bug 121124
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-08 19:48 UTC by jwakeen
Modified: 2008-02-11 18:03 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jwakeen 2008-02-08 19:48:14 UTC
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.");
    }
Comment 1 Vitezslav Stejskal 2008-02-11 09:48:33 UTC
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
Comment 2 jwakeen 2008-02-11 16:42:50 UTC
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.
Comment 3 Dusan Balek 2008-02-11 18:03:41 UTC
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 ***