Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 410940

Summary: [preferences] "Formatter > Line Wrapping > Maximum line width" import failed from preferences file (set but ignored)
Product: [Eclipse Project] JDT Reporter: Christian MOMON <christian.momon>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: christian.momon, daniel_megert
Version: 4.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
An preference files setting Maximum Line Width to 160
none
Java file to reproduce the bug (line longer than 80 columns). none

Description Christian MOMON CLA 2013-06-17 12:34:12 EDT
Created attachment 232453 [details]
An preference files setting Maximum Line Width to 160

When import preferences (.epf file), the "Formatter > Line Wrapping > Maximum line width" value is well displayed in fromatter edit window, but the previous value is used on "save actions".
You have to open the Formatter edit window and click "OK" to activate the good value.

Way to reproduce:
1) in "Menu > Window > Preferences > Java > Code Style > Formatter > Edit > Line Wrapping", verify that "Maximum line width" is set to 80 column

2) in "Menu > Window > Preferences > Java > Editor > Save Actions", checked:
- "Perform the selected actions on save"
- "Format source code"
- "Format all line" is checked

3) open Foo.java file (cf. attachment)

4) add space char and verify that line 12 is wrapped on save action

5) load the foo.epf (cf. attachment)

6) in "Menu > Window > Preferences > Java > Code Style > Formatter > Edit > Line Wrapping", verify that "Maximum line width" is set to 160. Don't touch it an exit with Cancel twice

7) add space char and verify that line 12 is wrapped on save action

8) open "Menu > Window > Preferences > Java > Code Style > Formatter > Edit" and click "OK" and click "OK"

9) add space char and verify that line 12 is *NOT* wrapped on save action
Comment 1 Christian MOMON CLA 2013-06-17 12:36:15 EDT
Created attachment 232454 [details]
Java file to reproduce the bug (line longer than 80 columns).

I attach a Foo.java file to reproduce the bug.
Comment 2 Dani Megert CLA 2013-06-18 11:02:29 EDT

*** This bug has been marked as a duplicate of bug 189804 ***