StableValue and non-deterministic iteration order
Remi Forax
forax at univ-mlv.fr
Fri Sep 5 17:12:56 UTC 2025
For me,
Map.copyOf() is worst, it is designed to do defensive copy, but you can not use it to do a defensive copy because the user of your library may rely on the Map iteration order..
Rémi
> From: "Kevin Bourrillion" <kevin.bourrillion at oracle.com>
> To: "Stephen Colebourne" <scolebourne at joda.org>, "core-libs-dev"
> <core-libs-dev at openjdk.org>
> Sent: Friday, September 5, 2025 5:22:47 PM
> Subject: Re: StableValue and non-deterministic iteration order
> Just as a corroborating data point, it’s banned at my previous company too, and
> this is a big reason why. Deterministic iteration is a very good thing.
> (Personal opinion: I’ve come to view non-deterministic iteration as a risky
> optimization in general, that is usually not called for.)
> From: core-libs-dev <core-libs-dev-retn at openjdk.org> on behalf of Stephen
> Colebourne <scolebourne at joda.org>
> Date: Friday, September 5, 2025 at 12:13 AM
> To: core-libs-dev <core-libs-dev at openjdk.org>
> Subject: StableValue and non-deterministic iteration order
> In summary, the current Map.of() is a bit of a hand grenade IMO, and
> something I pretty much banned at my previous company. Which is a
> problem given its key role in StableValue.
> Stephen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20250905/6c0f1b62/attachment.htm>
More information about the core-libs-dev
mailing list