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

Bug 324745

Summary: ']]>' is not correctly escaped in String to-many attributes
Product: [Modeling] EMF Reporter: Carsten Reckord <reckord>
Component: XML/XMIAssignee: Ed Merks <Ed.Merks>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Kenn.Hussey
Version: 2.5.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Carsten Reckord CLA 2010-09-08 10:13:39 EDT
When saving XML, the character sequence ]]> is not correctly escaped when occuring in a String to-many attribute. 

We are stumbling over this when saving java method bodies in UML OpaqueBehavior.body. This fails for method bodies like

writer.println("<![CDATA[stuff]]>");

which is currently encoded as

writer.println(&quot;&lt;![CDATA[stuff]]>&quot;);

(note the unescaped ']]>')

Specifically, I think in XMLSave.saveDataTypeMany(), Escape.escapeText() should be used instead of Escape.escape().
Comment 1 Ed Merks CLA 2010-09-08 12:41:59 EDT
The fix is committed to CVS for 2.7.  I assume it's pretty easy to work around this problem in older releases.
Comment 2 Ed Merks CLA 2010-11-05 05:41:29 EDT
The fix is available in the latest build for the stream.