Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 243079 - Name collision with OCL additional operations
Summary: Name collision with OCL additional operations
Status: CLOSED FIXED
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: 1.2.0   Edit
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: 1.2.1   Edit
Assignee: Christian Damus CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-04 12:52 EDT by Laurent Goubet CLA
Modified: 2011-05-27 02:41 EDT (History)
1 user (show)

See Also:


Attachments
TestCase reproducing this bug (5.80 KB, text/plain)
2008-08-04 12:52 EDT, Laurent Goubet CLA
give.a.damus: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Goubet CLA 2008-08-04 12:52:32 EDT
Created attachment 109081 [details]
TestCase reproducing this bug

OCL does not allow a third party plug-in to provide additional operations when their name collide with existing operations even if their signature does not correspond.

As an example, we cannot provide a "last()" EOperation on the primitive type String since a "last()" operation already exists as a predefined operation on OrderedSet(T). In such a case, the "callOperation" method of the EvaluationEnvironment will not be called since an operationCode will be associated to the OperationCallExp by the default EvaluationVisitor.

The attached JUnit 3 TestCase reproduces this use case.
Comment 1 Christian Damus CLA 2008-08-04 12:56:11 EDT
Oo!  Thanks, especially, for the JUnit test case.  That is most helpful.
Comment 2 Christian Damus CLA 2008-08-27 16:41:13 EDT
Committed a fix to the 1.2.2 release.  This bug also revealed a latent problem int the AbstractEnvironment implementation of getAdditionOperations(C) and getAdditionAttributes(C), in which they would return null instead of an empty list as required by the contract.

Thanks again for the test case; I included it mostly as is.  I had to change the assertion because the UnsupportedOperation wouldn't work; the OCL evaluation catches and handles RuntimeExceptions.
Comment 3 Laurent Goubet CLA 2008-08-28 03:57:44 EDT
Thanks, works wonders with the svn version :)
Comment 4 Christian Damus CLA 2008-08-29 09:41:46 EDT
Fix available in R1_2_maintenance: 1.2.2.M200808290729.
Comment 5 Christian Damus CLA 2008-08-30 21:15:44 EDT
Fix available in HEAD: 1.3.0.I200808302022.
Comment 6 Ed Willink CLA 2011-05-27 02:39:15 EDT
Closing after over a year in verified state.
Comment 7 Ed Willink CLA 2011-05-27 02:41:24 EDT
Closing after over a year in verified state.