<div dir="ltr"><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">We've observed that when using `DROP_DEBUG` in conjunction with `CodeBuilder#localVariable` and/or `localVariableType`, some (otherwise useless) constant pool entries are still being created (which contain, I believe, both the variable name and descriptor). This was observed using a backport of the JDK classfile API based on JDK 25.</div><br clear="all"></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Would this be expected behavior? Is there a separate step needed to clean the constant pool for cases like this?</div></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">It looks to me to be the consequence of how the default methods for local variable creation are implemented, e.g.:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">    default CodeBuilder localVariable(int slot, String name, ClassDesc descriptor, Label startScope, Label endScope) {<br>        return localVariable(slot,<br>                             constantPool().utf8Entry(name),<br>                             constantPool().utf8Entry(descriptor),<br>                             startScope, endScope);<br>    }<br></div><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">The constant pool is accessed even when `DROP_DEBUG` is enabled, because that flag is used later on in the process, and it seems that these entries are never dropped, even if they are unused.</div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">- DML • he/him<br></div></div></div>