Bug 491623 - Erroneous character output to UML
Summary: Erroneous character output to UML
Status: NEW
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 1.1.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-13 15:24 EDT by Chris Wilkinson CLA
Modified: 2016-04-20 14:49 EDT (History)
3 users (show)

See Also:


Attachments
Test case SysML project (4.12 KB, application/x-zip-compressed)
2016-04-13 16:08 EDT, Chris Wilkinson CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Wilkinson CLA 2016-04-13 15:24:18 EDT
The string character "<" included in a string field of a profile (ocra:contract below)is written to the UML as "&lt;". The profile is applied to a constraint specification. This is the line from the offending UML.

<ocra:contract xmi:id="_zgnVEODtEeWVnvZ8K98owA" name="addition_behavior" comment="--the output of the addition gate is the result of the addition of the two inputs" assume="true;" guarantee="always (out = 10 iff ((in_1 + in_2) >= 10)) and always (out = (in_1 + in_2) iff ((in_1 + in_2) &lt;= 10));" refinedby="" base_Constraint="_P6_-kOCMEeWkB9rJha_4NQ"/>

Here the &lt; string should be <

Strangely, > does not seem to have the same issue.
Comment 1 Chris Wilkinson CLA 2016-04-13 16:08:36 EDT
Created attachment 260937 [details]
Test case SysML project

This example test case illustrates the problem.
Comment 2 Benoit Maggi CLA 2016-04-14 04:22:08 EDT
I reproduced the problem in Mars 1.1.4.

Steps: 
 - create an UML model
 - create a constraint
 - write <> in the constraintSpec
=> the result in UML file
    <specification xmi:type="uml:LiteralString" xmi:id="_fcXs4AIZEeaXgfGvyAf00A" name="constraintSpec" value="&lt;>"/>

The problem is present in papyrus core.
Comment 3 Christian Damus CLA 2016-04-14 08:31:27 EDT
Why is this a problem?  This is standard XML entity encoding.  Every XML parser converts the &lt; entity to a single left-angle-bracket character when reading the file.
Comment 4 Chris Wilkinson CLA 2016-04-20 14:49:39 EDT
Not the one I wrote, although it does now after discovering this.