<div dir="ltr"><div dir="ltr">Hi Maurizio,<br></div><div><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 16, 2024 at 4:37 PM Maurizio Cimadamore <<a href="mailto:maurizio.cimadamore@oracle.com">maurizio.cimadamore@oracle.com</a>> wrote:<br></div><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><p>Instead, it would be better if you just created a new visitor in
Flow whose only responsibility is that of populating the
DummyVariable map you already have.</p>
<p>This new visitor might keep track of the innermost "interesting"
enclosing context, and when you create the dummy variable, you
note that context down.</p></div></blockquote><div>Nice idea... see <span style="font-family:monospace"><a href="https://github.com/openjdk/jdk/compare/master...archiecobbs:jdk:dummy-variable-detector?expand=1">08c8b1f3c64</a></span> for a stab at it.</div><div><div><br></div><div>I added special logic to include pseudo-tags for <span style="font-family:monospace">STATIC_INITIALIZER</span> and <span style="font-family:monospace">INSTANCE_INITIALIZER</span>.<br></div><div><br></div></div><div>There are surely some trade-offs regarding what types are "interesting", might be worth tweaking.</div><div><br></div><div>Here are the stats from the JDK:<br></div><div><br></div><div><span style="font-family:monospace"> 42 METHODDEF<br> 32 IF<br> 21 TRY<br> 10 FORLOOP<br> 3 DOLOOP<br> 2 WHILELOOP<br> 2 CASE<br> 1 FOREACHLOOP</span></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>