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

Summary: Add a formatting option for special if statement wrapping
Product: editor Reporter: -Silver-
Component: Formatting & IndentationAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Windows 7 x64   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: IDE log

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