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 129166 - "Add newline before the brace" does not work
Summary: "Add newline before the brace" does not work
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Options (show other bugs)
Version: 6.x
Hardware: PC Solaris
: P3 blocker (vote)
Assignee: issues@editor
URL:
Keywords: SIMPLEFIX
Depends on:
Blocks:
 
Reported: 2008-03-04 16:29 UTC by Petr Dvorak
Modified: 2008-04-14 11:52 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 Petr Dvorak 2008-03-04 16:29:08 UTC
Product Version: NetBeans IDE Dev (Build 200803021202)
Java: 1.5.0_13; Java HotSpot(TM) Client VM 1.5.0_13-b05
System: SunOS version 5.10 running on x86; UTF-8; cs_CZ (nb)

I decided to open this as a new issue, although I have already added a comment with more or less the same content
somewhere else.

Go to Editing > Editor Settings > Java Editor, click ellipsis (...) button by the Indentation engine in the Properties
window, a window with the settings for the indentation engine appears. If you check/uncheck "Add newline before the
brace", it has no effect - the result of a code formating (Shift+Alt+F) is always:

while (true) {
  // some code
}

instead of (in the case that a newline should be added):

while
{
  // some code
}

(Note: If it is possible to enable this option in the Options, it should work, otherwise the potential programmer is
indeed confused. I think the "Advanced options" button should be removed asap)
Comment 1 Vitezslav Stejskal 2008-03-05 10:35:52 UTC
Please use the formatting options in Tools-Options -> Java Code.
Comment 2 Petr Dvorak 2008-03-07 17:03:41 UTC
Just an idea - what about fixing the issue by imediate removal of the "Advanced options" button from the Options dialog?
It's been planned, so lets do it! If the settings under the "advanced options" do not work, they are useless there and
the one who tries to use them makes some opinion about this.

It just looks really strange if the choices under settings do not work. It is the same as if you just placed the button
"Auto-generate the application I want" and the check-box "Make it with no bugs" right bellow. It would have the same
effect in the end... Well - as a kind of a miracle - you can suddenly have as much advanced options as you want:o)!
Comment 3 Vitezslav Stejskal 2008-03-11 13:32:02 UTC
Don't worry we will get to it. But please note that the 'Advanced Options' contain also options from other modules. It's
not editor's call to remove them altogether. Also not all the advanced options are broken or useless and you would be
surprised how many people use some of them. On the other hand you are completely right that this has been dragging for
quite too long now and we should finally act.
Comment 4 Petr Dvorak 2008-03-11 13:42:13 UTC
I know "vstejskal" and I apologize for being a bit sarcastic in the last comment. We are still at the DEV stage, it's
time enough to fix these minor (but the more confusing) bugs.
Comment 5 Vitezslav Stejskal 2008-03-12 15:10:52 UTC
I hid the property. I'm not sure about nodes for the other editors, but for some of them we should probably do the same.
http://hg.netbeans.org/main/rev/75cfebede4f2
Comment 6 Petr Dvorak 2008-04-14 11:52:01 UTC
Verified: 20080411