StableValue and non-deterministic iteration order

Archie Cobbs archie.cobbs at gmail.com
Fri Sep 5 20:50:49 UTC 2025


On Fri, Sep 5, 2025 at 3:32 PM Pavel Rappo <pavel.rappo at gmail.com> wrote:

> Be it Map.of or HashMap, there's no user-defined order. The only
> user-defined order one can currently get is by using LinkedHashMap. In
> the future though, we may get SequencedMap.of.


I vote for adding SequencedMap.of(). That seems like a good solution to the
problem at hand, as well as a generally useful addition.

Of course if you believe that argument, then SequencedSet.of() would also
be a good addition, since Set.of() also makes no ordering guarantees.

-Archie

-- 
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20250905/872772d9/attachment.htm>


More information about the core-libs-dev mailing list