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

Bug 350344

Summary: [pivot] collectNested fails on heterogeneous collections
Product: [Modeling] OCL Reporter: Ed Willink <ed>
Component: CoreAssignee: OCL Inbox <mdt-ocl-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Ed Willink CLA 2011-06-25 02:49:52 EDT
For

Sequence{Sequence{'this and', 'that'}, 'the other'}->collectNested(s : String | s.toUpperCase())

the iteration fails on a non-String first term.

NB. The current IteratorsTest tests have no nested collections on which to collectNested is exercised. The nested test on collect is wierd

Sequence{Sequence{'this and', 'that'}, Sequence{'the other'}}->collect(s : Sequence(String) | s.toUpperCase())

using a collection iterator for the double depth and then flattenning. Equivalent code is

Sequence{Sequence{'this and', 'that'}, Sequence{'the other'}}->collect(s : Sequence(String) | s->collect(toUpperCase()))

Philosophical issue. How can a Collection of collections be collected if collect iterates over non-collection elements?