| Summary: | ->filter(MyType) seems to change the order of the list it is applied to | ||
|---|---|---|---|
| Product: | [Modeling] Acceleo | Reporter: | Laurent Delaigue <laurent.delaigue> |
| Component: | Core | Assignee: | Project Inbox <acceleo-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | laurent.goubet, stephane.begaudeau |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows Vista | ||
| Whiteboard: | |||
|
Description
Laurent Delaigue
This is due to us expecting "OCL" typing and infering the return type of some operation from those. In particular, this snippet
-----8<-----
if (xxx instanceof ArrayList) {
result = OCL.createSequence();
} else if (xxx instanceof LinkedHashSet) {
result = OCL.createOrderedSet();
} else if (xxx instanceof Set) {
result = OCL.createSet();
} else {
result = OCL.createBag();
}
----->8-----
must be replaced everywhere by a code that reduce the number of "unordered" collections we can create (users usually want ordered collections, even when they think they want unordered ones :p) :
-----8<-----
if (xxx instanceof Bag) {
result = OCL.createBag();
} else if (xxx instanceof HashSet && !(xxx instanceof LinkedHashSet)) {
result = OCL.createSet();
} else if (xxx instanceof Set) {
result = OCL.createOrderedSet();
} else {
result = OCL.createSequence();
}
----->8-----
The fix has been contributed on HEAD. It will be available in Acceleo 3.1.0 M7. |