Bug 325289

Summary: [formatter]org.eclipse.jdt.core.JavaCodeFormatter behaves in a non-GUI compatible way for xml preferences
Product: [Eclipse Project] JDT Reporter: Misha Koshelev <misha680>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: amj87.iitr, Olivier_Thomann
Version: 3.7   
Target Milestone: 3.7 M2   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Log of test case output that shows differences in formatting
none
Test.java.orig file for Test case (see log)
none
formatter.xml file that is being used
none
formatter.asprefs file that has been automatically created from formatter.xml (please see log) none

Description Misha Koshelev CLA 2010-09-14 15:58:32 EDT
Build Identifier: 20100617-1415

Command line invocation with an exported XML preferences file _does not_ match GUI behavior.

However, converting the same exact XML to a preferences format matches GUI behavior.

Test case included.

Thank you
Misha

Reproducible: Always
Comment 1 Misha Koshelev CLA 2010-09-14 15:59:31 EDT
Created attachment 178872 [details]
Log of test case output that shows differences in formatting
Comment 2 Misha Koshelev CLA 2010-09-14 15:59:55 EDT
Created attachment 178873 [details]
Test.java.orig file for Test case (see log)
Comment 3 Misha Koshelev CLA 2010-09-14 16:00:23 EDT
Created attachment 178874 [details]
formatter.xml file that is being used
Comment 4 Misha Koshelev CLA 2010-09-14 16:01:06 EDT
Created attachment 178875 [details]
formatter.asprefs file that has been automatically created from formatter.xml (please see log)
Comment 5 Misha Koshelev CLA 2010-09-14 16:01:15 EDT
Thank you
Comment 6 Misha Koshelev CLA 2010-09-14 19:36:09 EDT
Btw, this is an important note.

The command line formatter with the XML file is _consistent_ with the GUI formatter in version 3.3 from the file eclipse-java-europa-winter-linux-gtk-x86_64.tar.gz.

This means that the bug lies in the _GUI_ formatter of 3.6 which is reproduced with the command line version using the properties file, and _not_ in the command line formatter with the XML file.

Thank you
Misha
Comment 7 Ayushman Jain CLA 2010-09-15 04:20:12 EDT
Misha, I'm not sure if the command line formatter is supposed to work with xml configurations. I tried, but could not get ANY formatting at all with the xml settings. And with the .prefs file, where it actually does work, the behavious is consistent with GUI. So I dont think there should be a problem as such. 

Ofcourse things in the formatter would've changed from 3.3 time, and the reason why the behaviour there is consistent may be due to the fact that we were not formatting the line "Assert.assertEquals(excludePrefix + ";" + forModule + ".started;" + forModule + ".mandatory",
            model.get("excludePrefix"));" at all in 3.3. 

Can you confirm that the xml configuration does work with command line? (maybe change the alignment/tab spacing in some other lines and see if they get formatted in any way using .xml settings). 
Thanks!
Comment 8 Misha Koshelev CLA 2010-09-15 16:22:49 EDT
My apologies, you are correct. XML formatting is not supported.

Please feel free to close the issue.

Thank you
Misha
Comment 9 Olivier Thomann CLA 2010-09-15 16:24:48 EDT
Closing as INVALID
Comment 10 Olivier Thomann CLA 2010-09-21 17:54:30 EDT
Verified using I20100921-1024