Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 244948 - Additional operation on predefined types is not available on subtypes
Summary: Additional operation on predefined types is not available on subtypes
Status: CLOSED FIXED
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: 1.2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: M2   Edit
Assignee: Christian Damus CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-22 09:26 EDT by Radomil Dvorak CLA
Modified: 2011-05-27 02:41 EDT (History)
1 user (show)

See Also:


Attachments
Junit testcase (1.50 KB, application/octet-stream)
2008-08-22 09:26 EDT, Radomil Dvorak CLA
give.a.damus: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Radomil Dvorak CLA 2008-08-22 09:26:56 EDT
Created attachment 110672 [details]
Junit testcase

Assume, an additional operation is defined on Real.
I would expect a successful parse of an expression, which tries
to access it on Integer, which is a subclass of Real.
Similarly, an operation on OclAny would raise the same issue.

Seems the reason is org.eclipse.ocl.AbstractEnvironment.getAdditionalOperations(C), which collects the additionals within the classifier type hierarchy and uses 
UMLReflection.getAllSupertypes(C) only. 
That operation skips predefined types, I think by design (not in javadoc but other similar operations mention that (as those are known by the parser).


See the attached unit-test.
Comment 1 Artem Tikhomirov CLA 2008-08-22 10:08:50 EDT
Sorry, accidentally touched pmc_approved flag. Trying to revert...
Comment 2 Christian Damus CLA 2008-08-30 16:26:48 EDT
Thanks for the testcase, Radek.  I added three more:  one for inheritance of additional OclAny operations and two for inheritance of additional attributes from Real and from OclAny.

Note, of course, that collections would not inherit operations from OclAny, and there is no concrete syntax for accessing attributes of collections.
Comment 3 Christian Damus CLA 2008-08-30 21:15:39 EDT
Fix available in HEAD: 1.3.0.I200808302022.
Comment 4 Ed Willink CLA 2011-05-27 02:39:46 EDT
Closing after over a year in verified state.
Comment 5 Ed Willink CLA 2011-05-27 02:41:36 EDT
Closing after over a year in verified state.