Discrepancy between JVMS and Hotspot

Pietro Braione pietro.braione at unimib.it
Thu Apr 24 22:34:57 UTC 2025


Hello to everyone. The JVMS v24 (but also all the JVMS since v8) at section 4.7.13 says that:

"There may be no more than one LocalVariableTable attribute per local variable in the attributes table of a Code attribute.”

(Something similar holds for the LocalVariableTypeTable attribute). But there are compilers (ecj) that, when a method has zero local variables, emit a single, zero-length LocalVariableTable attribute, and Hotspot happily accepts these classfiles.
Best,
Pietro Braione
University of Milano-Bicocca


More information about the jls-jvms-spec-comments mailing list