{"record":{"id":"5448b00f946abb28","repo":"oracle/graal","slug":"expected-a-map","errorCode":null,"errorMessage":"Expected a map.","messagePattern":"Expected a map\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/JsonReplayCodec.java","lineNumber":1968,"sourceCode":"                    }\n                    return deserializer.deserialize(map, this, proxyFactory);\n                } else {\n                    return json;\n                }\n            }\n\n            @Override\n            @SuppressWarnings(\"unchecked\")\n            public Object deserialize(Object json, CompilationProxies.ProxyFactory proxyFactory, String tag) throws DeserializationException {\n                if (json instanceof EconomicMap<?, ?>) {\n                    EconomicMap<String, Object> map = (EconomicMap<String, Object>) json;\n                    ObjectSerializer deserializer = tagSerializers.get(tag);\n                    if (deserializer == null) {\n                        throw new IllegalArgumentException(\"No deserializer registered for tag \" + tag);\n                    }\n                    return deserializer.deserialize(map, this, proxyFactory);\n                } else {\n                    throw new IllegalArgumentException(\"Expected a map.\");\n                }\n            }\n\n            private Architecture architecture;\n\n            @Override\n            public void setArchitecture(Architecture arch) {\n                architecture = arch;\n            }\n\n            @Override\n            public Architecture getArchitecture() {\n                return architecture;\n            }\n        };\n    }\n\n    /**","sourceCodeStart":1950,"sourceCodeEnd":1986,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/JsonReplayCodec.java#L1950-L1986","documentation":"The tagged overload deserialize(json, proxyFactory, tag) requires the node to be an EconomicMap — unlike the untagged overload, it cannot pass through scalars because it has no way to attach type information to them. IllegalArgumentException('Expected a map.') fires when the JSON node at that position is a scalar/array where an object map was required.","triggerScenarios":"A tagged deserialization lands on a non-map node: file structure drifted (a field that used to be an object became a plain value), hand-edited JSON inlining a scalar where an object belongs, or a codec version change moving a field's shape.","commonSituations":"Manual JSON restructuring; version skew changing whether a value is boxed in an object with a tag or written inline; parser differences producing lists where maps are expected.","solutions":["Inspect the replay file at the position indicated by the enclosing deserializer's context and restore the object node with its 'tag'","Re-record the file with the same build","If the value is legitimately a scalar, route it through the untagged deserialize overload instead"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"// Guard the node kind before the tagged call\nif (!(json instanceof EconomicMap<?,?>)) {\n    throw new IllegalArgumentException(\"Expected a tagged object node, got: \" + json);\n}","tryCatchPattern":null,"preventionTips":["Do not restructure replay JSON by hand (inlining objects as scalars breaks the tagged format)","Validate tree shape (object nodes where tags are expected) before deserialization"],"tags":["graalvm","replay","deserialization","json"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}