Bug 325289 - [formatter]org.eclipse.jdt.core.JavaCodeFormatter behaves in a non-GUI compatible way for xml preferences
Summary: [formatter]org.eclipse.jdt.core.JavaCodeFormatter behaves in a non-GUI compat...
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.7 M2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-14 15:58 EDT by Misha Koshelev CLA
Modified: 2010-09-21 17:54 EDT (History)
2 users (show)

See Also:


Attachments
Log of test case output that shows differences in formatting (2.01 KB, text/x-log)
2010-09-14 15:59 EDT, Misha Koshelev CLA
no flags Details
Test.java.orig file for Test case (see log) (672 bytes, application/octet-stream)
2010-09-14 15:59 EDT, Misha Koshelev CLA
no flags Details
formatter.xml file that is being used (28.94 KB, text/xml)
2010-09-14 16:00 EDT, Misha Koshelev CLA
no flags Details
formatter.asprefs file that has been automatically created from formatter.xml (please see log) (22.35 KB, application/octet-stream)
2010-09-14 16:01 EDT, Misha Koshelev CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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