{"record":{"id":"dc94e9d5b45883ef","repo":"oracle/graal","slug":"option-setting-has-does-not-match-the-pattern-nam","errorCode":null,"errorMessage":"Option setting has does not match the pattern <name>=<value>: %s","messagePattern":"Option setting has does not match the pattern <name>=<value>: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler.options/src/jdk/graal/compiler/options/OptionsParser.java","lineNumber":135,"sourceCode":"     * @throws IllegalArgumentException if there's a problem parsing any of {@code options}\n     */\n    public static void parseOptions(String[] options, EconomicMap<OptionKey<?>, Object> values, Iterable<OptionDescriptors> loader) {\n        EconomicMap<String, String> settings = EconomicMap.create();\n        for (String option : options) {\n            parseOptionSettingTo(option, settings);\n        }\n        parseOptions(settings, values, loader);\n    }\n\n    /**\n     * Parses a given option setting string and adds the parsed key and value to {@code dst}.\n     *\n     * @param optionSetting a string matching the pattern {@code <name>=<value>}\n     */\n    public static void parseOptionSettingTo(String optionSetting, EconomicMap<String, String> dst) {\n        int eqIndex = optionSetting.indexOf('=');\n        if (eqIndex == -1) {\n            throw new IllegalArgumentException(\"Option setting has does not match the pattern <name>=<value>: \" + optionSetting);\n        }\n        dst.put(optionSetting.substring(0, eqIndex), optionSetting.substring(eqIndex + 1));\n    }\n\n    /**\n     * Splits a list of option settings into an array of options. If {@code options} starts with a\n     * non-letter character, that character is used as the delimiter between options. Otherwise,\n     * whitespace is the delimiter.\n     *\n     * @param options string containing a separated list of option settings.\n     * @return an array of strings containing the individual parsed options.\n     * @throws IllegalArgumentException if a non-whitespace delimiter is used and the delimiter\n     *             appears repeated contiguously in {@code options}.\n     */\n    public static String[] splitOptions(String options) {\n        String sepRegex = \"\\\\s+\";\n        String toParse = options;\n        if (!options.isEmpty() && !Character.isLetter(options.charAt(0))) {","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler.options/src/jdk/graal/compiler/options/OptionsParser.java#L117-L153","documentation":"Thrown by OptionsParser.parseOptionSettingTo when an option setting string does not contain an '=' character. GraalVM options are always passed as <name>=<value> pairs (e.g. in -Dgraal.* JVM flags or MX subprocess configuration), and this method is the central splitter for such strings. The message text itself contains a typo ('has does not match'), but the failure is simply a missing equals sign.","triggerScenarios":"Calling OptionsParser.parseOptionSettingTo(\"PrintGraph\") or parseOptions/parseOptionSettings with a list where an element like \"Dump\" or \"CompileThreshold\" has no '='. Also triggered when a value itself contains no '=' but a quoting bug upstream dropped it (e.g. shell stripping, an empty value written as \"Name=\" is fine, \"Name\" alone is not).","commonSituations":"Passing -Dgraal.PrintGraph=false style flags manually with a typo; building option strings programmatically by concatenation and forgetting the '='; MX or CI scripts passing a bare option name; a trailing whitespace-only or flag-like token ('--foo') leaking into the options list.","solutions":["Check the offending string shown in the message and add the missing '=' and value (e.g. 'PrintGraph' -> 'PrintGraph=false').","If the string looks correct, print the exact list elements passed to parseOptions to find where quoting/concatenation dropped the '='.","In shell scripts, quote the whole flag: -Dgraal.\"$OPT\"=\"$VAL\" rather than assembling it unquoted.","Sanitize input lists before parsing: skip empty/blank elements and elements that are pure flags."],"exampleFix":"// before\nOptionsParser.parseOptionSettingTo(\"PrintGraph\", values);\n\n// after\nOptionsParser.parseOptionSettingTo(\"PrintGraph=false\", values);","handlingStrategy":"validation","validationCode":"boolean isValidOptionSetting(String s) {\n    return s != null && s.indexOf('=') > 0;\n}\n\n// before parsing\nfor (String setting : settingsList) {\n    if (!isValidOptionSetting(setting)) {\n        throw new IllegalArgumentException(\"Malformed option setting (expected <name>=<value>): '\" + setting + \"'\");\n    }\n}\nOptionsParser.parseOptions(settingsList, values, loader);","typeGuard":null,"tryCatchPattern":"try {\n    OptionsParser.parseOptionSettingTo(setting, dst);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"<name>=<value>\")) {\n        throw new ConfigException(\"Option '\" + setting + \"' is missing '='; expected <name>=<value>\", e);\n    }\n    throw e;\n}","preventionTips":["Always assemble option strings as name + \"=\" + value, never paste raw names.","Validate user-supplied option strings with indexOf('=') > 0 before handing them to Graal's parser.","In shell scripts, quote -Dgraal.\"$NAME\"=\"$VALUE\" so '=' survives word splitting."],"tags":["graalvm","options","configuration","illegal-argument"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}