Community
Participate
Working Groups
3.1 (Not available as a Bugzilla option) The definition of collectNested in the Acceleo documentation is wrong. The overloads of collectNested for Sequence and OrderedSet to return Sequence are missing. The overloads of collectNested for Bag and Set to return Bag are missing. The implementation appears to return Bag for all Collection kinds which makes it impossible to map one ordered collection to another. [A quick check of the OCL implementation suggests that this is an Acceleo rather than OCL bug.]
Correction: It's just the documentation that's wrong. [My source was a Set rather than an OrderedSet.]
The documentation as a whole needs a good maintenance, thanks for highlighting this one.
You may want to leverage the Acceleo transformation that generates the Indigo OCL Standard Library documentation from the candidate OMG OCL Standard Library model. I should get time in the next couple of months to provide OCL 2.4 models and resolutions at which point the Acceleo templates to auto-gen the specification should be re-useab;e for other purposes.
The documentation of Acceleo mentions that "The type of the resulting collection depends on the type of self." However, the first line of the documentation for the content assist indeed mentions that the signature is "Bag(T2) collectNested(OclExpression expr)" even on an OrderedSet self. This is due to the oclstdlib incorrectly describing the operation. org.eclipse.ocl.ecore/model/oclstdlib.ecore has "OrderedSet(T)_Class.collectNested(OclExpression) : Bag(T2)". The EvaluationVisitorImpl, however, correctly uses an ArrayList (Sequence) for the result of this call.
(In reply to Laurent Goubet from comment #2) > The documentation as a whole needs a good maintenance, thanks for > highlighting this one. The Acceleo issue to be addressed. Returning this Bug to Acceleo. (In reply to Laurent Goubet from comment #4) > This is due to the oclstdlib incorrectly describing the operation. An OCL bug to be addressed. Bug 490982 raised.