eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[evaluation] Cannot evaluate EnumerationLiteral property #1421

Closed eclipse-ocl-bot closed 2 hours ago

eclipse-ocl-bot commented 2 hours ago

| --- | --- | | Bugzilla Link | 455394 | | Status | RESOLVED FIXED | | Importance | P3 normal | | Reported | Dec 16, 2014 15:02 EDT | | Modified | Jan 26, 2015 07:56 EDT | | Version | 5.0.0 | | Reporter | Yuwen Hu |

Description

Created attachment 249480\ Simple model contains two classes and an association

We defined a very simple UML model which contains two classes and an association. Open the model with UML editor, open interactive xtext console, select that association, and then input "self.memberEnd->select(e|e.aggregation=Aggregation::composite)". Nothing will be return.\ That's a wrong result.

This problem occurs since we update feature"org.eclipse.ocl.examples.unified.core" to version="3.4.3.v20141030-1510". Before that the OCL console works fine.

Please check below plugins first\ <plugin\ id="org.eclipse.ocl.examples.library"\ download-size="0"\ install-size="0"\ version="3.4.3.v20141027-1352"\ unpack="false"/>

<plugin\ id="org.eclipse.ocl.examples.pivot"\ download-size="0"\ install-size="0"\ version="3.4.3.v20141030-1510"\ unpack="false"/>\ Because only this two plugin changes.

SimpleUML.uml

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Dec 17, 2014 15:07

(In reply to Yuwen Hu from comment #0)

"self.memberEnd->select(e|e.aggregation=Aggregation::composite)".

Should be AggregationKind. Otherwise confirmed.

eclipse-ocl-bot commented 2 hours ago

By Yuwen Hu on Dec 17, 2014 15:14

Yes, the expression should be\ "self.memberEnd->select(e|e.aggregation=AggregationKind::composite)"\ Typing error.

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Dec 17, 2014 16:04

The regression was caused by Bug 448470 which chased the migration to using UML rather than Pivot objects for UML evaluation. Unfortunately the value of e.aggregation is an Ecore Enumerator rather than a UML EnumerationLiteral. Boxing into Pivot values hid this anomally. Now it's a problem. The Pivot support will have to cope with the failure of MDT/UML2 to use UML values. It seems like a MDT/UML2 bug but one with too long a history to be changed.

eclipse-ocl-bot commented 2 hours ago

By Yuwen Hu on Dec 17, 2014 16:09

Today I also debugged source code and notice the DomainType casting logic inside equal operation implementation.

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Dec 18, 2014 02:37

(In reply to Yuwen Hu from comment #4)

Today I also debugged source code and notice the DomainType casting logic inside equal operation implementation.

Is this a question/bug report/praise?

eclipse-ocl-bot commented 2 hours ago

By Yuwen Hu on Dec 18, 2014 03:40

(In reply to Ed Willink from comment #5)

(In reply to Yuwen Hu from comment #4)

Today I also debugged source code and notice the DomainType casting logic inside equal operation implementation.

Is this a question/bug report/praise?

No, never mind that DomainType things. I just mean I debugged code and found the place, those code help me to understand and agree with your analysis.

But back to the bug itself, is it easy to fix?

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Dec 18, 2014 10:54

(In reply to Yuwen Hu from comment #6)

No, never mind that DomainType things.

The promotoive of org.eclipse.ocl.examples... to org.eclipse.ocl... is in progress for M5 so it is difficult to provide interim fixes - Papyrus won't adjust till very late.

DomainType simplifies to Type as part of the promotion.

But back to the bug itself, is it easy to fix?

I've fixed but have to figure out how to release it. Probably I can do one last pre-promotion build so that you can get an N/I-build with the fix.

The fix for Bug 448470 has to be retracted and the true fix incorporated. EMF does not support onward navigation from EEnums thus: self.eLiterals.name fails for an EEnum. So the conversion to/from Ecore values must handle the irregularity for both UML and Ecore.

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Dec 18, 2014 12:16

(In reply to Ed Willink from comment #7)

I've fixed but have to figure out how to release it. Probably I can do one last pre-promotion build so that you can get an N/I-build with the fix.

Would you like to give

http://www.eclipse.org/modeling/download.php?file=/modeling/mdt/ocl/downloads/drops/5.1.0/N201412181126/mdt-ocl-Update-N201412181126.zip

a try?

eclipse-ocl-bot commented 2 hours ago

By Yuwen Hu on Jan 21, 2015 09:37

(In reply to Ed Willink from comment #8)

(In reply to Ed Willink from comment #7)

I've fixed but have to figure out how to release it. Probably I can do one last pre-promotion build so that you can get an N/I-build with the fix.

Would you like to give

http://www.eclipse.org/modeling/download.php?file=/modeling/mdt/ocl/ downloads/drops/5.1.0/N201412181126/mdt-ocl-Update-N201412181126.zip

a try?

Hi Ed,

I tried this package at the end of last year. Your fix is work.\ Sorry to forget let you know.

Now I think it is need to merge back 5.0.3 maintenance branch.

Thank you very much.

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Jan 25, 2015 13:17

(In reply to Yuwen Hu from comment #9)

Now I think it is need to merge back 5.0.3 maintenance branch.

Thank you very much.

Awkward since 5.0.X requires strong API compatibility.

Backport pushed to maintenance/R5.0 for SR2. Available as 5.0.4 maintenance build.

(Bug 458359 picks up a CG failure exposed by the additional test.)