<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr">The iteration order is deterministic. The problem raised in that thread was that the seed is hidden and uncontrollable. </div><div dir="ltr"><br></div><div dir="ltr">IMO if you want a Map that has order, use a LinkedHashMap (or the idea is SequencedMap.of is also appealing). However, even if you don’t want to depend on iteration order, sometimes there are bugs that unintentionally depend on that order, so it would still be great to control the seed in order to have reproducibility in tests. </div><div dir="ltr"><br><blockquote type="cite">On Sep 5, 2025, at 08:23, Kevin Bourrillion <kevin.bourrillion@oracle.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style>@font-face { font-family: "Cambria Math"; }
@font-face { font-family: Aptos; }
p.MsoNormal, li.MsoNormal, div.MsoNormal { margin: 0in; font-size: 10pt; font-family: Aptos, sans-serif; }
span.EmailStyle19 { font-family: Aptos, sans-serif; color: windowtext; }
.MsoChpDefault { font-size: 10pt; }
@page WordSection1 { size: 8.5in 11in; margin: 1in; }
div.WordSection1 { page: WordSection1; }</style>
<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.)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></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<o:p></o:p></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<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div></blockquote></body></html>