Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 322125

Summary: "EAnnotation.eContainer()" does not work with EMF 2.6
Product: [Modeling] OCL Reporter: Florian Thienel <florian>
Component: CoreAssignee: OCL Inbox <mdt-ocl-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: ed
Version: 3.0.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
This test case runs fine with EMF 2.4 and fails with EMF 2.6 none

Description Florian Thienel CLA 2010-08-09 07:26:34 EDT
Created attachment 176147 [details]
This test case runs fine with EMF 2.4 and fails with EMF 2.6

The attached test case runs fine with EMF 2.4. With EMF 2.6 the result of getEAllOperations of the EClass "EAnnotation" does not include the operation
"eContainer" and other operations. The OCL interpreter uses getEAllOperations to find the operation, this fails with EMF 2.6.

Although the Ecore inheritence hierarchy has changed according to Bug 322005, it should be possible use "eContainer" with OCL.
Comment 1 Ed Willink CLA 2010-08-09 12:24:17 EDT
I'm sorry, Florian, this chgange in 3.6M4 came as a surprise to me too, but I eventually recognised that it was arguably a big fix. There has never been any justification for eContainer() to work, since OCL should support OMG UML behavior.

It is not even reasonable to expect that container() work since OCL does not support MOF reflection. There is an OMG issue in progress for this, which MDT/OCL will pioneer/track.

MDT/OCL does provide a workaround. See http://wiki.eclipse.org/MDT/OCL/FAQ#How_do_I_invoke_methods_such_as_eContainer.28.29.2C_eContents.28.29.2C_eGet.28.29.3F
Comment 2 Florian Thienel CLA 2010-08-09 16:34:05 EDT
(In reply to comment #1)
Thanks anyway. At least there is a way around this issue.
Comment 3 Ed Willink CLA 2011-05-27 02:59:38 EDT
Closing INVALIDs