Home » Modeling » OCL » ClassCastException when evaluating constraint on UML::Datatype property
ClassCastException when evaluating constraint on UML::Datatype property [message #1682536] |
Tue, 17 March 2015 19:34 |
Klaas Gadeyne Messages: 165 Registered: July 2009 |
Senior Member |
|
|
Hi,
Please consider the papyrus project in attach. It contains a testprofile, and a model to which this profile is applied.
When I validate the model, the model validation view reports (correctly) that 2 constraints are violated, yet a third one is reported to be invalid due to a CCE.
Severity Description Element Parent Type
Error The 'MyInstance::groupMultiplicity' constraint result is invalid for'«MyInstance»model::myInstance::myProperty'
- java.lang.ClassCastException: org.eclipse.ocl.examples.domain.library.UnsupportedOperation cannot be cast to org.eclipse.ocl.examples.domain.library.LibraryBinaryOperation <<MyInstance <Slot> myProperty model::myInstance EMF Problem
3 invariants are defined on the Myinstance stereotype, each one checking if an attribute of the BaseProperty stereotype is actually defined (ie. property multiplicity = 1). For a standard attribute typed by a primitive type (Attribute1), and an attribute typed by a stereotype (Attribute2), this works fine. Yet, for the attribute groupMultiplicity, typed by a datatype, the evaluated constraint hence reports to be invalid, whereas the groupMultiplicity attribute of the myProperty attribute in MyClass is not null and hence I would expect that this constraint would be ok.
Am I missing something here, or is this a bug?
Tooling versions:
Eclipse Modeling Tools 4.4.2.20150219-0708 epp.package.modeling null
OCL Examples and Editors SDK 3.4.4.v20150213-2254 org.eclipse.ocl.examples.feature.group Eclipse Modeling Project
Papyrus UML 1.0.2.v201502181349 org.eclipse.papyrus.sdk.feature.feature.group Eclipse Modeling Project
|
|
|
Re: ClassCastException when evaluating constraint on UML::Datatype property [message #1684140 is a reply to message #1682536] |
Wed, 18 March 2015 09:50 |
Ed Willink Messages: 7670 Registered: July 2009 |
Senior Member |
|
|
<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi<br>
<pre wrap="">UnsupportedOperation is not good.
Sounds a bit like a bug [1] I fixed recently regarding evaluation of user data types, specifically EDate, which is not built-in, and so fell off the end of a list into an UnsupportedOperationException.
Using OCL->Validate on the UML model in my workspace gives me
<img src="https://www.eclipse.org/forums/index.php?t=getfile&id=21227" alt="">
</pre>
without any obvious sign of any exceptions.<br>
<br>
Regards<br>
<br>
Ed Willink<br>
<br>
[1] <a class="moz-txt-link-freetext" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=460755">https://bugs.eclipse.org/bugs/show_bug.cgi?id=460755</a><br>
<br>
On 17/03/2015 19:34, Klaas Gadeyne wrote:<br>
</div>
<blockquote cite="mid:me9vjo$3tv$1@xxxxxxxxe.org" type="cite">
<pre wrap="">Hi,
Please consider the papyrus project in attach. It contains a testprofile, and a model to which this profile is applied.
When I validate the model, the model validation view reports (correctly) that 2 constraints are violated, yet a third one is reported to be invalid due to a CCE.
Severity Description Element Parent Type
Error The 'MyInstance::groupMultiplicity' constraint result is invalid for'«MyInstance»model::myInstance::myProperty'
- java.lang.ClassCastException: org.eclipse.ocl.examples.domain.library.UnsupportedOperation cannot be cast to org.eclipse.ocl.examples.domain.library.LibraryBinaryOperation <<MyInstance <Slot> myProperty model::myInstance EMF Problem
3 invariants are defined on the Myinstance stereotype, each one checking if an attribute of the BaseProperty stereotype is actually defined (ie. property multiplicity = 1). For a standard attribute typed by a primitive type (Attribute1), and an attribute typed by a stereotype (Attribute2), this works fine. Yet, for the attribute groupMultiplicity, typed by a datatype, the evaluated constraint hence reports to be invalid, whereas the groupMultiplicity attribute of the myProperty attribute in MyClass is not null and hence I would expect that this constraint would be ok.
Am I missing something here, or is this a bug?
Tooling versions:
Eclipse Modeling Tools 4.4.2.20150219-0708 epp.package.modeling null
OCL Examples and Editors SDK 3.4.4.v20150213-2254 org.eclipse.ocl.examples.feature.group Eclipse Modeling Project
Papyrus UML 1.0.2.v201502181349 org.eclipse.papyrus.sdk.feature.feature.group Eclipse Modeling Project
</pre>
</blockquote>
<br>
</body>
</html>
-
Attachment: jfggjffb.png
(Size: 14.80KB, Downloaded 264 times)
|
|
| | | | | |
Goto Forum:
Current Time: Thu Sep 26 03:53:17 GMT 2024
Powered by FUDForum. Page generated in 0.05017 seconds
|