eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

Template parameters out of sequence in OCL.uml #181

Closed eclipse-ocl-bot closed 1 month ago

eclipse-ocl-bot commented 1 month ago

| --- | --- | | Bugzilla Link | 185967 | | Status | CLOSED FIXED | | Importance | P2 major | | Reported | May 08, 2007 11:24 EDT | | Modified | May 17, 2013 15:23 EDT | | Version | 1.1.0 | | Reporter | Christian Damus |

Description

With HEAD as of 8 May 2007.

When importing a UML model into EMF, the UML-to-Ecore conversion generates ETypeParameters in a different order than the UML template parameter specifications. Order of parameters in the generic signature is important in Java,\ as this determines the order in which substitutions must be declared.

The pattern is not random; it appears that ETypeParameters are generated in the order in which they are resolved. In my case, the template parameters used by generalizations (in the template binding serving as the generalclassifier) appear first, before any template parameters that are not used by generalizations.

eclipse-ocl-bot commented 1 month ago

By Christian Damus on May 08, 2007 11:26

Created attachment 66304 Example demonstrating the problem

The attached model exhibits this behaviour in the CollectionType, MessageType, and TypeType classes in the types package. All three specialize PredefinedType but have a template parameter that is specified first.

:notepad_spiral: OCL.uml

eclipse-ocl-bot commented 1 month ago

By James Bruck on May 14, 2007 22:05

Created attachment 67168 template reordering

The order of parameters returned from TemplateSignature#getParameters is incorrect. getOwnedParameters seems to return the parameters in the correct order. There appears to be an issue with getParameters.

:notepad_spiral: mixedTemplateParams.patch

eclipse-ocl-bot commented 1 month ago

By James Bruck on May 14, 2007 22:08

The problem can be observed by simply selecting the redefinable template signature of the CollectionType class in the UML editor. If you look at the properties view, for "Parameter" the order is incorrect although the order does appear correctly in the tree view.

eclipse-ocl-bot commented 1 month ago

By James Bruck on May 16, 2007 11:03

Upon closer examination, it seems that the parameter reference collection's order is differnent from the owned parameter's collection. Ultimately, the order of the parameters collection decides the order of how these things appear.

The solution would be to simply reorder your parameters. I believe the code is fine the way it is now.

When you built your model, you probably reordered your owned parameters after creating them? This did not cause the parameters to get reordered from the other collection.

eclipse-ocl-bot commented 1 month ago

By Christian Damus on May 16, 2007 13:42

Thanks, James. I'll fix up my model ASAP.

eclipse-ocl-bot commented 1 month ago

By Christian Damus on May 16, 2007 14:56

Kenn, please consider approving this bug for commit into RC1.

I need to reorder the values in the "parameter" feature of the following classes in the OCL.uml model:

OCL\
    Types\
        CollectionType<C, O>\
        MessageType<C, O, P>\
        TypeType<C, O>

This has no effect on generated code or the URIs of any elements in the OCL.uml model.

eclipse-ocl-bot commented 1 month ago

By Christian Damus on May 16, 2007 15:19

Committed the change described in comment 6.

eclipse-ocl-bot commented 1 month ago

By Nick Boldt on Jan 28, 2008 16:37

Move to verified as per bug 206558.

eclipse-ocl-bot commented 1 month ago

By Ed Willink on May 27, 2011 02:39

Closing after over a year in verified state.

eclipse-ocl-bot commented 1 month ago

By Ed Willink on May 27, 2011 02:41

Closing after over a year in verified state.