Another discrepancy between JVMS and Hotspot
Pietro Braione
pietro.braione at unimib.it
Wed Jul 2 17:21:04 UTC 2025
Hello to everyone. The JVMS v24 (but also all the JVMS since v8) at section 4.7.6 says that:
"If the constant pool of a class or interface C contains at least one CONSTANT_Class_info entry (§4.4.1) which represents a class or interface that is not a member of a package, then there must be exactly one InnerClasses attribute in the attributes table of the ClassFile structure for C.”
In attachment to this method you can find a class, generated from a standard LambdaForm, for which this is not true. The class LambdaForm$BMH.class has a CONSTANT_Class_info entry for a nested class (java/lang/invoke/BoundMethodHandle$Species_L) but no InnerClasses attribute. However Hotspot accepts this class. The LambdaForm from which this class was generated is:
LambdaForm: BMH.reinvoke=Lambda(a0:L/SpeciesData<L>,a1:L)=>{
t2:L=Species_L.argL0(a0:L);
t3:L=MethodHandle.invokeBasic(t2:L,a1:L);t3:L}
Best,
Pietro Braione
University of Milano-Bicocca
More information about the jls-jvms-spec-comments
mailing list