Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351512 - [pivot] oclAsSet() malfunctions as a collect body
Summary: [pivot] oclAsSet() malfunctions as a collect body
Status: CLOSED FIXED
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: 3.2.0   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: M4   Edit
Assignee: OCL Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-08 02:40 EDT by Ed Willink CLA
Modified: 2013-05-20 11:36 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2011-07-08 02:40:09 EDT
Using Ecore.ecore, select EObject

Evaluating:
eOperations.eType.oclAsSet().name
Results:
'EClass'
'EBoolean'
'EResource'
'EObject'
'EStructuralFeature'
'EReference'
'EEList'
'ETreeIterator'
'EEList'
'EJavaObject'
'EJavaObject'
'EBoolean'
'EJavaObject'

But

Evaluating:
eOperations->collect(eType)->collect(oclAsSet())->collect(name)
Results:
'EObject'
'EObject'
'EObject'
'EObject'
'EObject'
'EObject'
'EObject'
'EObject'
'EObject'
'EObject'
'EObject'
'EObject'
'EObject'

Why the difference?
Comment 1 Ed Willink CLA 2011-11-09 05:02:05 EST
eOperations->collect(eType)->collect(c : EClassifier | c.oclAsSet())->collect(name)

works and

eOperations->collect(eType)->collect(self.oclAsSet())->collect(name)

reproduces the problem. Looks like an implicit source problem.
Comment 2 Ed Willink CLA 2011-11-10 05:13:19 EST
The problem is that the implicit collect did not flatten the Bag<Set<>> and so the subsequent name property had to search out to self to find a name.

EssentialOCLLeft2RightVisitor.resolveOperationReturnType now flattens the return type declaration for collect.

Additionally some bit rot had set in and in M3, an implicit collect as a source was not flattened either. NavigationOperatorCSScopeAdapter.computeLookup fixed.

Tests added. Pushed to master.
Comment 3 Ed Willink CLA 2013-05-20 11:36:05 EDT
CLOSED after a year in the RESOLVED state.