Details
-
Bug
-
Resolution: Fixed
-
P4
-
21
-
b22
-
generic
-
generic
-
Verified
Description
Consider this code example:
cob.constantInstruction(clazz.describeConstable().orElseThrow());
This fails for primitive classes, as Classfile API always assume ClassDescs are always encodeable as a class constant. The check in BytecodeHelpers should check for
if (constantValue instanceof ClassDesc value && !value.isPrimitive())
As only classes or interfaces or arrays are eligible to be encoded in class constants. Discovered while converting SerialPersistentFieldsTest forJDK-8294977.
cob.constantInstruction(clazz.describeConstable().orElseThrow());
This fails for primitive classes, as Classfile API always assume ClassDescs are always encodeable as a class constant. The check in BytecodeHelpers should check for
if (constantValue instanceof ClassDesc value && !value.isPrimitive())
As only classes or interfaces or arrays are eligible to be encoded in class constants. Discovered while converting SerialPersistentFieldsTest for
Attachments
Issue Links
- relates to
-
JDK-8310649 [lworld] PrimitiveClassConstantTest fails with ClassFormatError
-
- Open
-