The non-deterministic iteration order of Immutable Collections
Kasper Nielsen
kasperni at gmail.com
Fri Mar 24 17:53:51 UTC 2023
>
> I don't (yet) want to be prescriptive in any potential solution. And I
> know that this has been discussed before. I mostly just want to start a
> conversation and see how much traction it gets.
>
Would
java.util.SequencedMap.of(...)
java.util.SequencedMap.copyOf(SequencedMap map)
java.util.SequencedSet.of(...)
java.util.SequencedSet.copyOf(SequencedSet set)
solve your problem?
I would love to see them included in JEP 431.
Should be fairly simply to implement just have a side
array that maintains the elements in order.
/Kasper
More information about the core-libs-dev
mailing list