{"record":{"id":"eed95135d895ffa8","repo":"oracle/graal","slug":"no-options-specified-for-methodfilter","errorCode":null,"errorMessage":"No options specified for MethodFilter:","messagePattern":"No options specified for MethodFilter:","errorType":"console","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/CompilationTask.java","lineNumber":545,"sourceCode":"                EconomicMap<String, String> optionSettings = null;\n                for (String option : OptionsParser.splitOptions(perMethodOptions)) {\n                    String prefix = \"MethodFilter:\";\n                    if (option.startsWith(prefix)) {\n                        MethodFilter filter = MethodFilter.parse(option.substring(prefix.length()));\n                        if (filter.matches(getMethod())) {\n                            // Begin accumulating options\n                            optionSettings = EconomicMap.create();\n                        } else if (optionSettings != null) {\n                            // This is a new MethodFilter: so stop collecting options\n                            break;\n                        }\n                    } else if (optionSettings != null) {\n                        OptionsParser.parseOptionSettingTo(option, optionSettings);\n                    }\n                }\n                if (optionSettings != null) {\n                    if (optionSettings.isEmpty()) {\n                        throw new IllegalArgumentException(\"No options specified for MethodFilter:\");\n                    }\n                    values = EconomicMap.create();\n                    OptionsParser.parseOptions(optionSettings, values, OptionsParser.getOptionsLoader());\n                }\n            } catch (Exception e) {\n                values = null;\n                TTY.println(e.toString());\n                TTY.println(\"Errors encountered during \" + Options.PerMethodOptions.getName() + \" parsing.  Exiting...\");\n                HotSpotGraalServices.exit(-1, jvmciRuntime);\n            }\n\n            if (values != null) {\n                newOptions = newOptions.derive(values);\n                if (PrintCompilation.getValue(newOptions)) {\n                    TTY.println(\"Compiling \" + getMethod() + \" with extra options: \" + new OptionValues(values));\n                }\n            }\n        }","sourceCodeStart":527,"sourceCodeEnd":563,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/CompilationTask.java#L527-L563","documentation":"When Options.PerMethodOptions is parsed, a MethodFilter: line starts collecting option settings until the next line; if the collected map is empty when parsing ends, IllegalArgumentException('No options specified for MethodFilter:') is thrown. The enclosing catch prints the error and calls HotSpotGraalServices.exit(-1), so the JVM terminates.","triggerScenarios":"Setting -Dgraal.PerMethodOptions to a value/string containing a 'MethodFilter:' line (or a line that starts a new filter) that is the last line, or is followed only by another MethodFilter: line, so zero options accumulate for it.","commonSituations":"Trailing 'MethodFilter:...' entry with no key=value lines after it in a per-method options file or -Dgraal.PerMethodOptions string; typos like 'MethodFilter:Foo' followed by an option line the parser does not recognize as such; copy-paste truncation of an options file.","solutions":["Ensure every MethodFilter: entry is followed by at least one option assignment (e.g. MethodFilter:Foo, then a subsequent 'OptionName = value' line)","Remove the stray/trailing MethodFilter: line that has no options","Validate the PerMethodOptions content before startup (lint the file) since the failure kills the JVM"],"exampleFix":"# before (-Dgraal.PerMethodOptions content)\nMethodFilter:HotSpotBlowup.*\n\n# after\nMethodFilter:HotSpotBlowup.*\nInlineEverything = true","handlingStrategy":"validation","validationCode":"boolean perMethodOptionsOk(String s) {\n    String[] lines = s.split(\"\\n\");\n    boolean sawFilter = false;\n    for (String l : lines) {\n        if (l.startsWith(\"MethodFilter:\")) { if (sawFilter) return false; sawFilter = true; }\n        else if (sawFilter && l.matches(\"\\\\s*\\\\w+\\\\s*=.*\")) sawFilter = false;\n    }\n    return !sawFilter; // false means a MethodFilter with no options follows\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Lint PerMethodOptions strings/files before launching (failure exits the JVM)","End every MethodFilter: block with at least one Option = value line","Unit-test option files in CI with the same parser settings"],"tags":["graal-compiler","options","configuration","startup"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}