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 - not possible to have "else if" on one line together with keeping braces in case of "else { if ... }"
Summary: not possible to have "else if" on one line together with keeping braces in ca...
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2015-11-09 09:35 UTC by ijacek
Modified: 2015-11-09 11:25 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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