Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Error when with classifier reference in EnumerationLiterals
Error when with classifier reference in EnumerationLiterals [message #1105198] Mon, 09 September 2013 13:54 Go to next message
felix Kurth is currently offline felix KurthFriend
Messages: 5
Registered: July 2013
Junior Member
Hi,
The uml specification descripes a reference called classifier for EnumerationLiteral and InstanceSpecification. When setting the reference classifier by hand in the xmi file to the containing Enumeration this causes trouble. I am using a commercial UML Modeling tool setting this in its xmi Export. When loading this example model with uml Model Editor you will see the error i am describing. Although the superfluous classifier specification in the second EnumerationLiteral could also just be ignored.
<?xml version="1.0" encoding="UTF-8"?>
<uml:Model xmi:version="2.1" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmi:id="_f8a5714e-86c0-4925-a64c-23d3dcd80b72" name="MyRelease_with_Custimization">
  <packagedElement xmi:type="uml:Profile" xmi:id="_7D4FDC6D-1BCC-4904-B52C-A1CD5EA7609A" name="C Profile">
    <packagedElement xmi:type="uml:Enumeration" xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CEnumeration" name="C Storage Class_Enumeration" redefinedClassifier="_67E11EAD-9B71-4438-88B0-556F698F836CEnumeration">
      <ownedLiteral xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CEnumerationLiteral" name="empty">
        <specification xmi:type="uml:LiteralInteger" xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CLiteralInteger"/>
      </ownedLiteral>
      <ownedLiteral xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CEnumerationLiteralstatic" name="static" classifier="_67E11EAD-9B71-4438-88B0-556F698F836CEnumeration">
        <specification xmi:type="uml:LiteralInteger" xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CLiteralIntegerstatic" value="1"/>
      </ownedLiteral>
      <ownedLiteral xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CEnumerationLiteralauto" name="auto">
        <specification xmi:type="uml:LiteralInteger" xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CLiteralIntegerauto" value="2"/>
      </ownedLiteral>
      <ownedLiteral xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CEnumerationLiteralregister" name="register">
        <specification xmi:type="uml:LiteralInteger" xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CLiteralIntegerregister" value="3"/>
      </ownedLiteral>
      <ownedLiteral xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CEnumerationLiteralextern" name="extern">
        <specification xmi:type="uml:LiteralInteger" xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CLiteralIntegerextern" value="4"/>
      </ownedLiteral>
    </packagedElement>
  </packagedElement>
</uml:Model>

Re: Error when with classifier reference in EnumerationLiterals [message #1105327 is a reply to message #1105198] Mon, 09 September 2013 17:46 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I think you need to read the various XMI serialization specifications
very very carefully to determine whether the redundant "classifier"
container reference is gratuitous or erroneous.

Even if it is erroneous, this is at least the third distinct occasion on
which I have seen this problem arise, so it would seem helpful if the
MDT/UML2 model loader could ignore no-change assignments of the container.

(The candidate XMI for UM 2.5 has the same problem.)

Please raise a Bugzilla.

Regards

Ed Willink


On 09/09/2013 14:54, felix Kurth wrote:
> Hi,
> The uml specification descripes a reference called classifier for
> EnumerationLiteral and InstanceSpecification. When setting the
> reference classifier by hand in the xmi file to the containing
> Enumeration this causes trouble. I am using a commercial UML Modeling
> tool setting this in its xmi Export. When loading this example model
> with uml Model Editor you will see the error i am describing. Although
> the superfluous classifier specification in the second
> EnumerationLiteral could also just be ignored.
> <?xml version="1.0" encoding="UTF-8"?>
> <uml:Model xmi:version="2.1"
> xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML"
> xmi:id="_f8a5714e-86c0-4925-a64c-23d3dcd80b72"
> name="MyRelease_with_Custimization">
> <packagedElement xmi:type="uml:Profile"
> xmi:id="_7D4FDC6D-1BCC-4904-B52C-A1CD5EA7609A" name="C Profile">
> <packagedElement xmi:type="uml:Enumeration"
> xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CEnumeration" name="C
> Storage Class_Enumeration"
> redefinedClassifier="_67E11EAD-9B71-4438-88B0-556F698F836CEnumeration">
> <ownedLiteral
> xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CEnumerationLiteral"
> name="empty">
> <specification xmi:type="uml:LiteralInteger"
> xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CLiteralInteger"/>
> </ownedLiteral>
> <ownedLiteral
> xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CEnumerationLiteralstatic"
> name="static"
> classifier="_67E11EAD-9B71-4438-88B0-556F698F836CEnumeration">
> <specification xmi:type="uml:LiteralInteger"
> xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CLiteralIntegerstatic"
> value="1"/>
> </ownedLiteral>
> <ownedLiteral
> xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CEnumerationLiteralauto"
> name="auto">
> <specification xmi:type="uml:LiteralInteger"
> xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CLiteralIntegerauto"
> value="2"/>
> </ownedLiteral>
> <ownedLiteral
> xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CEnumerationLiteralregister"
> name="register">
> <specification xmi:type="uml:LiteralInteger"
> xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CLiteralIntegerregister"
> value="3"/>
> </ownedLiteral>
> <ownedLiteral
> xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CEnumerationLiteralextern"
> name="extern">
> <specification xmi:type="uml:LiteralInteger"
> xmi:id="_67E11EAD-9B71-4438-88B0-556F698F836CLiteralIntegerextern"
> value="4"/>
> </ownedLiteral>
> </packagedElement>
> </packagedElement>
> </uml:Model>
>
>
Re: Error when with classifier reference in EnumerationLiterals [message #1218691 is a reply to message #1105327] Fri, 29 November 2013 11:42 Go to previous message
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 344
Registered: August 2013
Senior Member
Hi

I have exactly the same problem. RSA 7.5 sets classifier reference in an exported XMI-file.
Parser throws an exception:
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.uml2.uml.internal.impl.EnumerationImpl@323bfd7a (name: AnimalIdKindCodeType, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false)' is not legal. (file:/C:/Work/workspace/OclToXPath/model2/SMDataModel.uml, 729, 78)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2671)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardReferences(XMLHandler.java:1156)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardReferences(XMLHandler.java:1037)
	at org.eclipse.uml2.uml.internal.resource.UMLHandler.endElement(UMLHandler.java:47)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:606)
	at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1303)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2717)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:302)
	at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:253)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
	... 3 more
Caused by: java.lang.UnsupportedOperationException
	at org.eclipse.emf.common.util.BasicEList$UnmodifiableEList.move(BasicEList.java:1009)
	at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHelperImpl.java:1189)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2666)
	... 24 more

When I remove classifier attribute manually, everithing works.
I think it's a bug in Eclipse, because according to UML Specification classifier attribute is required.

[Updated on: Fri, 29 November 2013 11:47]

Report message to a moderator

Previous Topic:update attributes of class programmatically
Next Topic:UML help
Goto Forum:
  


Current Time: Fri Apr 26 08:25:11 GMT 2024

Powered by FUDForum. Page generated in 0.03505 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top