Bug 89299 - [formatter] Keep empty array initializer on one line option has no effect
Summary: [formatter] Keep empty array initializer on one line option has no effect
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-28 17:12 EST by Olivier Thomann CLA
Modified: 2005-03-29 10:15 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2005-03-28 17:12:08 EST
Using latest, this option has no effect. Set to true/false gives the same result.
The code formatter preferences page clearly shows the problem.
Comment 1 Olivier Thomann CLA 2005-03-28 17:12:31 EST
Fixed and released in HEAD.
Regression tests updated.
Comment 2 Markus Keller CLA 2005-03-29 06:06:41 EST
The FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE already had an effect
before this change.

When FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER (prefs page > Braces > Array
Initializer) was set to NEXT_LINE or NEXT_LINE_SHIFTED, the user could disable
wrapping before the opening brace by checking "Keep empty array initalizer on
one line".

Now, the FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE option does what it
did before, *plus* it always forces a line break inside an empty array
initializer (but not inside non-empty array initializers). IMO, this new
behavior does not make sense since it mixes two options.
Comment 3 Olivier Thomann CLA 2005-03-29 09:30:08 EST
Do you want me to revert the change?
I found the problem by looking at the code formatter preferences page were the
option has apparently no effect.
Comment 4 Olivier Thomann CLA 2005-03-29 10:15:36 EST
Closing as INVALID.
I revert the change. I could then reproduce bug 81497 that is now fixed.