eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[pivot] oclAsSet() malfunctions as a collect body #740

Closed eclipse-ocl-bot closed 3 hours ago

eclipse-ocl-bot commented 3 hours ago

| --- | --- | | Bugzilla Link | 351512 | | Status | CLOSED FIXED | | Importance | P3 normal | | Reported | Jul 08, 2011 02:40 EDT | | Modified | May 20, 2013 11:36 EDT | | Version | 3.2.0 | | Reporter | Ed Willink |

Description

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?

eclipse-ocl-bot commented 3 hours ago

By Ed Willink on Nov 09, 2011 05:02

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.

eclipse-ocl-bot commented 3 hours ago

By Ed Willink on Nov 10, 2011 05:13

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.

eclipse-ocl-bot commented 3 hours ago

By Ed Willink on May 20, 2013 11:36

CLOSED after a year in the RESOLVED state.