Incorrect CONSTANT_Class format when writing frame types. Fails to pass Java 9 validation.
In ClassWriter#writeFrameTypes
, ClassWriter#newClass
is called.
The method should normally take the internal name of the class, e.g. java/lang/Object
.
However, #writeFrameTypes
prepends L
and appends ;
, passing the descriptor instead. This is inconsistent with the class file format.
In Java 8 virtual machines (and below), this wasn't a problem because the VM did not strictly validate the format of a Class constant. However, Java 9 virtual machines do impose this restriction, resulting in a ClassFormatError, such as the following:
Error: LinkageError occurred while loading main class Test
java.lang.ClassFormatError: Illegal class name "Ljava/lang/Object;" in class file Test