{"record":{"id":"b7f069cbc53f4e85","repo":"oracle/graal","slug":"unknown-class-classname-for-constant-value","errorCode":null,"errorMessage":"Unknown class ${className} for constant${value}","messagePattern":"Unknown class (.+?) for constant(.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/JsonReplayCodec.java","lineNumber":484,"sourceCode":"                case \"Integer\" -> {\n                    return Integer.parseUnsignedInt(value, HEX_RADIX);\n                }\n                case \"Byte\" -> {\n                    return (byte) Integer.parseUnsignedInt(value, HEX_RADIX);\n                }\n                case \"Short\" -> {\n                    return (short) Integer.parseUnsignedInt(value, HEX_RADIX);\n                }\n                case \"Long\" -> {\n                    return Long.parseUnsignedLong(value, HEX_RADIX);\n                }\n                case \"Float\" -> {\n                    return hexToFloat(value);\n                }\n                case \"Double\" -> {\n                    return hexToDouble(value);\n                }\n                default -> throw new IllegalArgumentException(\"Unknown class \" + className + \" for constant\" + value);\n            }\n        }\n    }\n\n    private static final class ResultMarkerSerializer implements ObjectSerializer {\n\n        @Override\n        public boolean serializesSubclasses() {\n            return true;\n        }\n\n        @Override\n        public Class<?> clazz() {\n            return SpecialResultMarker.class;\n        }\n\n        @Override\n        public String tag() {","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/JsonReplayCodec.java#L466-L502","documentation":"Mirror of error 144 on the read side: while deserializing a primitive constant, the 'class' field in the JSON must be one of Integer, Byte, Short, Long, Float, Double. Any other class name hits the default branch and throws IllegalArgumentException naming the unknown class and raw hex value.","triggerScenarios":"Replaying a JSON replay file that contains a constant entry with a class name this codec version does not recognize — e.g. 'Boolean' written by a newer codec, or a hand-edited/garbled file.","commonSituations":"Version skew: file written by a GraalVM that supports more primitive classes than the reading one; manual JSON edits; truncated/corrupt replay files where the class field reads as a wrong string.","solutions":["Use the same (or newer) GraalVM version to replay the file than the one that recorded it","Inspect the offending entry in the JSON (class/value pair from the message) and fix or remove it if the file was hand-edited","If you extended the writer (error 144), extend the reader switch with the matching cases"],"exampleFix":"// before\nswitch (className) {\n    case \"Integer\" -> { ... }\n    default -> throw new IllegalArgumentException(\"Unknown class \" + className + ...\n// after: add\n    case \"Boolean\" -> Boolean.parseBoolean(value);\n    case \"Character\" -> (char) Integer.parseUnsignedInt(value, HEX_RADIX);","handlingStrategy":"validation","validationCode":"static final Set<String> SUPPORTED_CONSTANT_CLASSES =\n    Set.of(\"Integer\", \"Byte\", \"Short\", \"Long\", \"Float\", \"Double\");\n\nif (!SUPPORTED_CONSTANT_CLASSES.contains(className)) {\n    throw new IllegalArgumentException(\"Replay file uses unsupported constant class: \" + className);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never replay files from newer GraalVM builds on older ones","Keep the serialize and deserialize switches side by side and update both together"],"tags":["graalvm","replay","deserialization","json"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}