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.
I had this method: public int something() { if (something == 1) return 12; else return something - 1; } and I've applied the Add braces hint, getting: public int something() { if (something == 1) { return 12; } else { return something - 1; } } Reformatting (Alt + Shift + F) the section results in: public int something() { if (something == 1) { return 12; } else { return something - 1; } } which is what was expected. Product Version = NetBeans IDE Dev (Build 20130628-216d1bc31969) Operating System = Windows 7 version 6.1 running on amd64 Java; VM; Vendor = 1.7.0_07 Runtime = Java HotSpot(TM) 64-Bit Server VM 23.3-b01
Created attachment 136544 [details] Formatting settings
*** Bug 232141 has been marked as a duplicate of this bug. ***
Integrated into 'main-silver', will be available in build *201307032300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/05bcf1a3655a User: Jan Lahoda <jlahoda@netbeans.org> Log: #232092: must set the given fileobject to the fake document so that the indenter reads the correct CodeStyle.
Fixed by the above change.