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.
When I try to do code autoformat (ALT + SHIFT + F) I get odd results when code contains lines: int i, c; for (i = 0, c = 1; i < itemsList.size(); i++) {} After each format, two spaces are added between "i = 0," and "c = 1" And, also, when I try to do int i, c; for (i = 0, c = itemsList.size(); i < c; i++) singleliner(); The result is non-compiling code in style of: for (i = 0 , { c } = items.size(); i { } < c; i++) singleliner(); BUT when the code is as such: for (int i = 0, c = items.size(); i < c; i++) singleliner(); Then auto format formats it correctly to: for (int i = 0, c = items.size(); i < c; i++) { singleliner(); } So definetly a parsing bug somewhere. Looks like parser is assuming that int definition should always be there in first part, because if it's not there, the autoformat seriously messes up....
Fixed. changeset 2aca29c3e071 in main details: http://hg.netbeans.org/main?cmd=changeset;node=2aca29c3e071
I think this is good candidate for patch 2
Integrated into 'main-golden', will be available in build *200901091401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/2aca29c3e071 User: Dusan Balek <dbalek@netbeans.org> Log: Issue #156411: Code format behaves oddly - fixed.
verified in Product Version: NetBeans IDE Dev (Build 20090112033331) Java: 1.6.0_11; Java HotSpot(TM) Client VM 11.0-b16 System: Linux version 2.6.24-23-generic running on i386; UTF-8; en_US (nb)
The fix has been ported into the release65_fixes repository. http://hg.netbeans.org/release65_fixes/rev/52b5cb0c1115