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 256647 - Add a formatting option for special if statement wrapping
Summary: Add a formatting option for special if statement wrapping
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.1
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-17 16:02 UTC by -Silver-
Modified: 2015-11-17 16:02 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
IDE log (274.83 KB, text/plain)
2015-11-17 16:02 UTC, -Silver-
Details

Note You need to log in before you can comment on or make changes to this bug.
Description -Silver- 2015-11-17 16:02:05 UTC
Product Version = NetBeans IDE 8.1 (Build 201510222201)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.8.0_60
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.60-b23

Reproducibility: Happens every time

Good afternoon,
in my company is used the following code convention (that is probably taken from the Oracle suggestions at this address: http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-136091.html)

Line wrapping for if statements should generally use the 8-space rule, since conventional (4 space) indentation makes seeing the body difficult. For example:

    //DON'T USE THIS INDENTATION
    if ((condition1 && condition2)
        || (condition3 && condition4)
        ||!(condition5 && condition6)) { //BAD WRAPS
        doSomethingAboutIt();            //MAKE THIS LINE EASY TO MISS
    } 

    //USE THIS INDENTATION INSTEAD
    if ((condition1 && condition2)
            || (condition3 && condition4)
            ||!(condition5 && condition6)) {
        doSomethingAboutIt();
    } 


Could you kindly add to the formatter an option to manage this particular if statement treatment?
Thanks and best regards,


--
Giuseppe Tin
Comment 1 -Silver- 2015-11-17 16:02:12 UTC
Created attachment 157380 [details]
IDE log