{"record":{"id":"272e5aaa6bd38e71","repo":"oracle/graal","slug":"unsupported-replay-file-filename","errorCode":null,"errorMessage":"Unsupported replay file: ${fileName}","messagePattern":"Unsupported replay file: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/ReplayCompilationSupport.java","lineNumber":169,"sourceCode":"                    return true;\n                }\n            }\n            return false;\n        }\n\n        /**\n         * Determines the replay file format from a file name.\n         *\n         * @throws IllegalArgumentException if {@code fileName} does not match a supported replay\n         *             file extension\n         */\n        public static ReplayFileFormat fromFileName(String fileName) {\n            for (ReplayFileFormat format : values()) {\n                if (format.matchesFileName(fileName)) {\n                    return format;\n                }\n            }\n            throw new IllegalArgumentException(\"Unsupported replay file: \" + fileName);\n        }\n    }\n\n    public static class Options {\n        // @formatter:off\n        @Option(help = \"Format used for recorded replay compilation files.\", type = OptionType.Debug)\n        public static final EnumOptionKey<ReplayFileFormat> ReplayFileFormat = new EnumOptionKey<>(ReplayCompilationSupport.ReplayFileFormat.Binary);\n        // @formatter:on\n    }\n\n    /**\n     * Checks whether the given method's compilation should be recorded according to the given\n     * options.\n     *\n     * @param options the option values\n     * @param method the method to check against the filter\n     * @return true if the method's compilation should be recorded\n     */","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/ReplayCompilationSupport.java#L151-L187","documentation":"Thrown by ReplayFileFormat.fromFileName when the given replay file name does not match any supported replay file extension (currently the Binary enum constant's extension). It is the format-detection entry point: it maps a file name to a codec, and refuses unknown formats with IllegalArgumentException.","triggerScenarios":"Calling ReplayCompilationSupport.ReplayFileFormat.fromFileName(fileName) with a name that matches no ReplayFileFormat's matchesFileName — e.g. passing a .txt, .json, or misspelled extension, or a bare path with no extension when configuring -Dgraal.ReplayCompilation with a replay file.","commonSituations":"User renames a replay file, exports it from another tool, or hand-edits the -Dgraal.ReplayCompilationFileName/-Dgraal.ReplayMethodFile path; the default option value (-Dgraal.ReplayFileFormat) disagrees with the actual file on disk; trailing whitespace/case mismatch in the extension.","solutions":["Check the supported extensions in the ReplayFileFormat enum and rename the file (typically to the binary replay extension) accordingly.","Regenerate the replay file with the same GraalVM build that replays it, keeping the default extension.","Verify the exact path string passed on the command line (typos, missing extension, wrong case)."],"exampleFix":"// before\nReplayFileFormat f = ReplayFileFormat.fromFileName(\"replay_dump.txt\");\n\n// after\n// use a file with a supported extension, e.g. the binary replay format\nReplayFileFormat f = ReplayFileFormat.fromFileName(\"replay.replaybin\");","handlingStrategy":"validation","validationCode":"String name = /* replay file name */;\nboolean supported = Arrays.stream(ReplayFileFormat.values())\n                .anyMatch(f -> f.matchesFileName(name));\nif (!supported) {\n    // regenerate the file or fix the name/extension before configuring replay\n    throw new IllegalArgumentException(\"Not a replay file: \" + name);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never rename replay files away from the extension produced by the recording build.","Generate and consume replay files with the same GraalVM build."],"tags":["graalvm","replay-compilation","file-format","configuration"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}