Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329326 - OPTION_FORMATTED does not work for final line break
Summary: OPTION_FORMATTED does not work for final line break
Status: RESOLVED WONTFIX
Alias: None
Product: EMF
Classification: Modeling
Component: XML/XMI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Server 2003
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ed Merks CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-03 04:50 EDT by David Michonneau CLA
Modified: 2010-11-05 07:51 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Michonneau CLA 2010-11-03 04:50:05 EDT
Build Identifier: M20080911-1700

The serialization OPTION_FORMATTED in XMI does not remove the last line break. This prevents to have a cross-platform identical serialization (as unix and windows will either use \r\n or \n for the line break)

Reproducible: Always

Steps to Reproduce:
1. Use XMIResourceImpl and set OPTION_FORMATTED to false
2. Serialize an EObject
3. There is a \r\n at the end of the serialized stream. There should be no line break characters.
Comment 1 Ed Merks CLA 2010-11-05 07:51:28 EDT
I'm not sure it's a good idea to try to produce a serialization without a line terminator on the last line.  Most editors would not produce such a result and will add such a character as soon as you try to edit a file without it.  Also, I can imagine changing this behavior adversely affecting existing clients too.  Looking closely, the xml header is on a different line too, so I'm not sure how removing the final linebreak is a good thing.

The whole point of this option was to eliminate the large amount of whitespace, i.e., to reduce significantly the number of bytes that need to be transmitted, not to produce a result that's the same across platforms because it includes no line separators.