<div dir="ltr"><br><div>Hi,</div><div><br></div><div>Since interfaces cannot have private fields, javac needs to generate a synthetic inner class to hold the $assertionsDisabled field.</div><div><br></div><div>A static initializer is also added to the interface, eagerly initializing the nested class, see the java.util.zip.Checksum for an example:</div><div><br></div><div><font face="monospace"> static {};<br>    Code:<br>         0: getstatic     #16                 // Field java/util/zip/Checksum$1.$assertionsDisabled:Z<br>         3: ifeq          6<br>         6: return</font></div><div><font face="monospace"><br></font></div><div>What is the purpose of this eager initialization in Lower::assertFlagTest? I would presume a lazy initialization of the nested class on the first run of an assert would be sufficient?</div><div><br></div><div>In fact when I remove this eager initialization, assertions seem to load the nested class just fine with -esa enabled, but avoid loading the nested class with assertions disabled. </div><div><br></div><div>Asking because this would save class loading common scenarios where the default method is always overridden and thus the default method with the assert is never executed.</div><div><br></div><div>Can we load these nested synthetic classes lazily?</div><div><br></div><div>Cheers,</div><div>Eirik.</div></div>