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 256455

Summary: not possible to have "else if" on one line together with keeping braces in case of "else { if ... }"
Product: java Reporter: ijacek
Component: EditorAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal Keywords: REGRESSION
Priority: P3    
Version: 8.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description ijacek 2015-11-09 09:35:04 UTC
Product Version = NetBeans IDE 8.1 (Build 201510222201)
Java; VM; Vendor = 1.8.0_66
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.66-b17

Reproducibility: Happens every time

I have the code
If () {
     if () {
         ...
     }
}
else {
    if ( ) {
      ...
    }
}

and I have all the braces settings at "leave alone". Formatting always removes the else { } braces and joins the condition to if else. That should not happen and it's a regression. It didn't happen in NB 8.0.
If I switch off the "special else if treatment" then it stays ok, but other appearances of else if without braces are wrapped (if is on a new line), so it doesn't help too