{"record":{"id":"6444081039fcf4dc","repo":"oracle/graal","slug":"java-speccompliance-mode-can-be-strict-or-ho","errorCode":null,"errorMessage":"--java.SpecCompliance: Mode can be 'strict' or 'hotspot'.","messagePattern":"--java\\.SpecCompliance: Mode can be 'strict' or 'hotspot'\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/EspressoOptions.java","lineNumber":286,"sourceCode":"        return new ArrayList<>(Arrays.asList(strings.split(File.pathSeparator)));\n    }\n\n    private static List<String> splitBySemiColon(String strings) {\n        return new ArrayList<>(Arrays.asList(strings.split(EspressoOptions.SEMI_COLON)));\n    }\n\n    public enum SpecComplianceMode {\n        STRICT,\n        HOTSPOT\n    }\n\n    private static final OptionType<SpecComplianceMode> SPEC_COMPLIANCE_OPTION_TYPE = new OptionType<>(\"SpecCompliance\", new Function<String, SpecComplianceMode>() {\n        @Override\n        public SpecComplianceMode apply(String s) {\n            try {\n                return SpecComplianceMode.valueOf(s.toUpperCase(Locale.ROOT));\n            } catch (IllegalArgumentException e) {\n                throw new IllegalArgumentException(\"--java.SpecCompliance: Mode can be 'strict' or 'hotspot'.\");\n            }\n        }\n    });\n\n    @Option(help = \"Force mimicking of hotspot behavior on unrespected specs points\", //\n                    category = OptionCategory.EXPERT, //\n                    stability = OptionStability.EXPERIMENTAL, //\n                    usageSyntax = \"hotspot|strict\") //\n    public static final OptionKey<SpecComplianceMode> SpecCompliance = new OptionKey<>(SpecComplianceMode.HOTSPOT, SPEC_COMPLIANCE_OPTION_TYPE);\n\n    public enum VerifyMode {\n        NONE,\n        REMOTE, // Verifies all bytecodes not loaded by the bootstrap class loader.\n        ALL\n    }\n\n    private static final OptionType<VerifyMode> VERIFY_MODE_OPTION_TYPE = new OptionType<>(\"VerifyMode\", new Function<String, VerifyMode>() {\n        @Override","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/EspressoOptions.java#L268-L304","documentation":"The OptionType converter for the --java.SpecCompliance option tries SpecComplianceMode.valueOf(s.toUpperCase()) and wraps any IllegalArgumentException when the string is neither 'strict' nor 'hotspot' (case-insensitive). The option controls whether Espresso mimics HotSpot behavior on points where it deviates from the JVMS.","triggerScenarios":"Passing --java.SpecCompliance=<value> (or context option java.SpecCompliance) where value is anything other than strict/hotspot, e.g. 'default', 'true', 'STRICT ' with trailing space.","commonSituations":"Copy-pasting JVM flags that have no Espresso equivalent; typos in CI launch configuration; scripts written against a different GraalVM version where accepted values differ.","solutions":["Use exactly --java.SpecCompliance=strict or --java.SpecCompliance=hotspot (case-insensitive).","Remove the flag to keep the default value, which is hotspot.","Check mx/graalvm flag documentation for the current option name and allowed values."],"exampleFix":"# before\n--java.SpecCompliance=default\n\n# after\n--java.SpecCompliance=strict","handlingStrategy":"validation","validationCode":"// Java launcher\nif (!List.of(\"strict\", \"hotspot\").contains(specCompliance.toLowerCase(Locale.ROOT))) {\n    throw new ConfigException(\"SpecCompliance must be strict|hotspot\");\n}","typeGuard":"static boolean validSpecCompliance(String s) {\n    return s != null && s.matches(\"(?i)(strict|hotspot)\");\n}","tryCatchPattern":null,"preventionTips":["Whitelist option values at config load time.","Print the accepted set in your tool's --help.","Fail fast at startup rather than deep inside the Truffle option parser."],"tags":["espresso","graalvm","configuration","options","cli"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}