<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div>For me,</div><div>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..</div><div><br data-mce-bogus="1"></div><div>Rémi</div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Kevin Bourrillion" <kevin.bourrillion@oracle.com><br><b>To: </b>"Stephen Colebourne" <scolebourne@joda.org>, "core-libs-dev" <core-libs-dev@openjdk.org><br><b>Sent: </b>Friday, September 5, 2025 5:22:47 PM<br><b>Subject: </b>Re: StableValue and non-deterministic iteration order<br></blockquote></div><div><style><!--
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Aptos;
panose-1:2 11 0 4 2 2 2 2 2 4;}
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:10.0pt;
font-family:"Aptos",sans-serif;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:12.0pt">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.)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt"> </span></p>
<div id="mail-editor-reference-message-container">
<div>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">core-libs-dev <core-libs-dev-retn@openjdk.org> on behalf of Stephen Colebourne <scolebourne@joda.org><br>
<b>Date: </b>Friday, September 5, 2025 at 12:13</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:black"> </span><span style="font-size:12.0pt;color:black">AM<br>
<b>To: </b>core-libs-dev <core-libs-dev@openjdk.org><br>
<b>Subject: </b>StableValue and non-deterministic iteration order</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"><br>
In summary, the current Map.of() is a bit of a hand grenade IMO, and<br>
something I pretty much banned at my previous company. Which is a<br>
problem given its key role in StableValue.<br>
<br>
Stephen</span></p>
</div>
</div>
</div>
</div>
</div><br></blockquote></div></div></body></html>