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

Bug 312901

Summary: Code generation: code formatting overrides line delimiter settings
Product: [Modeling] EMF Reporter: Henning Heitkoetter <hheitkoetter>
Component: ToolsAssignee: Dave Steinberg <davidms>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Ed.Merks
Version: unspecifiedFlags: Ed.Merks: iplog+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Use line delimiter none

Description Henning Heitkoetter CLA 2010-05-14 09:07:30 EDT
The java code generation tries to respect the existing line delimiter settings of a file (bug 164803). However, when using code formatting afterwards, no line delimiter is passed to the formatter. The formatter (DefaultCodeFormatter) thus uses the line delimiter specified by the system property line.separator.
That way, the code is reformatted with a possibly different delimiter.

I'll attach a patch.
Comment 1 Henning Heitkoetter CLA 2010-05-14 09:10:06 EDT
Created attachment 168533 [details]
Use line delimiter

The line delimiter used for code generation is passed to the code formatter.
Comment 2 Ed Merks CLA 2010-05-14 10:16:06 EDT
The contribution is committed to CVS for 2.6.  Thanks so much for the fix!! :-)
Comment 3 Ed Merks CLA 2010-05-19 06:43:13 EDT
The changes are in 2.6RC1.