Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350344 - [pivot] collectNested fails on heterogeneous collections
Summary: [pivot] collectNested fails on heterogeneous collections
Status: NEW
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: 3.1.0   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: OCL Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-25 02:49 EDT by Ed Willink CLA
Modified: 2011-06-25 02:49 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-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?