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 255541

Summary: Rename "Special else-if treatment" to something more intuitive
Product: editor Reporter: _ gtzabari <gtzabari>
Component: Formatting & IndentationAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Windows 7   
Issue Type: ENHANCEMENT Exception Reporter:

Description _ gtzabari 2015-09-24 12:06:22 UTC
Product Version: NetBeans IDE Dev (Build 201509180002)
Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27
System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb)
User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev

Netbeans currently provides two modes:

1. Newline after "else"
2. No newline after "else"

I am looking for a third mode: Newline after "else" statements unless the subsequent token is "if" (in which case no newline should occur between the two).

It doesn't seem possible to achieve this with the current Java formatting rules.
Comment 1 Dusan Balek 2015-09-24 13:21:16 UTC
Could you please attach a simple code snippet illustrating the desired formatting? Thanks.
BTW: Have you tried to check the "Special else-if Treatment" and to set the If Braces Generation to "Leave Alone"?
Comment 2 _ gtzabari 2015-09-24 13:57:26 UTC
You're right, that works.

Can you please rename "Special else-if treatment" to "Group else-if statements"? It's not intuitive what "special statement" means.
Comment 3 Dusan Balek 2015-09-24 14:57:31 UTC
I'm not sure that "Group else-if statements" is more intuitive, but anyway we are already feature/ui frozen for NB 8.1 now.