<div dir="ltr"><div dir="ltr">On Thu, Oct 17, 2024 at 5:34 AM Maurizio Cimadamore <<a href="mailto:maurizio.cimadamore@oracle.com">maurizio.cimadamore@oracle.com</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div>
<div>Funny to see the FOREACHLOOP popping out. This code is (at least)
from 17 years ago (!!) and predates any form of effectively final
analysis - back then even for-each required to hoist the variable
in a separate <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">final</code>
one :-)</div></div></blockquote><div><br></div><div>I was wondering about that as well. I didn't realize that there was a point where foreach() already existed and this effectively final tweak was added. I don't see a relevant JEP, did it predate the JEP process?<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>I realize, the important info is not where the dummy
variable is declared. It's the declaration of the variable it
points to in the initializer that matters!</div></div></blockquote><div><br></div><div>D'oh, yes of course... easy to fix though.</div><div><br></div><div>Here are the new stats - these look more like what one might expect:</div><div><br></div><div><span style="font-family:monospace"> 87 METHODDEF<br> 11 FORLOOP<br> 3 TRY<br> 3 IF<br> 3 FOREACHLOOP<br> 3 DOLOOP<br> 2 WHILELOOP<br> 1 CASE</span></div><div><br></div><div>Now there are 3 <span style="font-family:monospace">FOREACHLOOP</span>'s :)<br></div><div><br></div><div>-Archie<br></div></div><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Archie L. Cobbs<br></div></div>