Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 218607 - Order Preserving Sets
Summary: Order Preserving Sets
Status: CLOSED FIXED
Alias: None
Product: M2T
Classification: Modeling
Component: Xpand (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Arto Laurila CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-12 04:37 EST by Hannes Stauss CLA
Modified: 2013-02-21 08:10 EST (History)
3 users (show)

See Also:


Attachments
Tests and some fixes for intersect, union, without, SetType.newInstance (7.10 KB, patch)
2009-03-09 05:09 EDT, Sebastian Zarnekow CLA
sven.efftinge: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hannes Stauss CLA 2008-02-12 04:37:46 EST
Use LinkedHashMap internally instead of HashMap for oaw::Set in order to preserve insertion order when transforming lists to sets via the toSet operation. See http://www.openarchitectureware.org/forum/viewtopic.php?forum=2&showtopic=6823 for a more detailed discussion of the topic.
Comment 1 Karsten Thoms CLA 2008-02-12 09:31:02 EST
I have modified the test for CollectionTypeImpl's toSet() operation and modified CollectionTypeImpl on oAW 4.2 branch.

To do: Apply the same behaviour to M2T.
Comment 2 Sebastian Zarnekow CLA 2009-03-09 03:22:09 EDT
Collection.toSet uses a LinkedHashSet in m2t.

However, I cannot find any test for this behaviour, I'll add a patch with some tests.

Should union and intersect preserve the order of the elements as well?
Comment 3 Sebastian Zarnekow CLA 2009-03-09 05:09:52 EDT
Created attachment 127998 [details]
Tests and some fixes for intersect, union, without, SetType.newInstance
Comment 4 Sven Efftinge CLA 2009-03-09 09:29:26 EDT
patch applied
Comment 5 Karsten Thoms CLA 2013-02-21 08:10:35 EST
Bug resolved before Xpand 1.2 release date => Closing