Bug 89299

Summary: [formatter] Keep empty array initializer on one line option has no effect
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: martinae
Version: 3.1   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.