Bug 316325

Summary: [formatter] "Every Element on a New Line" formatting for enum's Constant Arguments is ignored
Product: [Eclipse Project] JDT Reporter: Amitay Dobo <amitayd>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann, srikanth_sankaran
Version: 3.5   
Target Milestone: 3.7 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Amitay Dobo CLA 2010-06-09 11:23:20 EDT
Build Identifier: 20090920-1017

The formatter ignores the "Wrap all elements, every element on a new line" for Constant Arguments. For enums with no arguments the settings does work. This is working both in the Preview pane of the formatter preferences, and when applying the formatter.



Reproducible: Always

Steps to Reproduce:

To reproduce:
1) Window/Preferences
2) Java/Code Style/Formatter
3) click Edit...
4) Select "Line wrapping" tab
5) Choose 'enum' declaration/ Constant arguments
6) Change the Line wrapping policy to "Wrap all elements, every element on a new line".


Expected:
Enum values will be formatted on a new line for each element, in the same way "regular" enums are when this setting is selected.

Actual:
The setting seem to have no effect on the formatting.

Additional info:
Trying to set this option in the parent, i.e. "'enum' declaration" had no effect as well (only on "regular" enums.
Comment 1 Olivier Thomann CLA 2010-06-09 11:41:27 EDT
Please provide a test case and formatter options used so that we can reproduce the defect.
The wrapping is applied only if the line is too long. If you want it in all cases, you need to set the "force" wrapping option.
Comment 2 Amitay Dobo CLA 2010-06-09 13:16:45 EDT
Olivier,
You are correct, setting the "force" wrapping option does produce the behavior I was expecting. Thank you very much for your help.
I misinterpreted "Constant Arguments" as "constants WITH arguments". Since the Preview's example for the non argumented constants was wrapped at the default 40 columns preview, since they exceed 40 cols.

Closing as invalid.
Comment 3 Frederic Fusier CLA 2010-06-21 05:25:14 EDT
Switch status to resolved as this must go through our milestone verification process...
Comment 4 Srikanth Sankaran CLA 2010-08-03 05:18:52 EDT
Verified for 3.7M1