{"record":{"id":"cedbfda4ccc9acbe","repo":"oracle/graal","slug":"file-line-cause","errorCode":null,"errorMessage":"{file}:{line}: {cause}","messagePattern":"\\{file\\}:\\{line\\}: \\{cause\\}","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/inlining/DirectedInliningRules.java","lineNumber":257,"sourceCode":"            return;\n        }\n        int commandSeparator = findCommandSeparator(commandLine);\n        if (commandSeparator < 0) {\n            throw invalidCommand(commandFile, lineNumber, commandLine);\n        }\n        String command = commandLine.substring(0, commandSeparator).trim().toLowerCase(Locale.ROOT);\n        String ruleSpec = commandLine.substring(commandSeparator + 1).trim();\n        if (ruleSpec.startsWith(String.valueOf(DIRECTIVE_SEPARATOR))) {\n            ruleSpec = ruleSpec.substring(1).trim();\n        }\n        if (ruleSpec.isEmpty()) {\n            throw invalidCommand(commandFile, lineNumber, commandLine);\n        }\n        Rule rule;\n        try {\n            rule = parseRule(ruleSpec);\n        } catch (IllegalArgumentException e) {\n            throw new IllegalArgumentException(commandFile + \":\" + lineNumber + \": \" + e.getMessage(), e);\n        }\n        switch (command) {\n            case \"inline\" -> inlineRules.add(rule);\n            case \"dontinline\" -> dontInlineRules.add(rule);\n            default -> throw invalidCommand(commandFile, lineNumber, commandLine);\n        }\n    }\n\n    private static String stripComment(String line) {\n        int commentStart = line.indexOf('#');\n        return commentStart < 0 ? line : line.substring(0, commentStart);\n    }\n\n    private static int findCommandSeparator(String commandLine) {\n        for (int i = 0; i < commandLine.length(); i++) {\n            char c = commandLine.charAt(i);\n            if (c == DIRECTIVE_SEPARATOR || Character.isWhitespace(c)) {\n                return i;","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/inlining/DirectedInliningRules.java#L239-L275","documentation":"While parsing each line of the directed inlining rules file, parseCommandFileLine (DirectedInliningRules.java:257) delegates to parseRule and rethrows any IllegalArgumentException prefixed with '<file>:<line>:' so the user knows exactly which rule line is malformed. The message itself comes from the inner parse error (e.g., empty rule, bad receiver type filter).","triggerScenarios":"Any syntax error in a rule line (after '#' comment stripping) in the file named by -Dgraal.DirectedInliningCommandFile: missing caller/callee, stray '@', bad receiver-type braces, etc.","commonSituations":"Hand-edited rules files; comments using the wrong comment character; copy-pasting rules from docs that mangle unicode dashes or quotes.","solutions":["Open the named file at the reported line number and fix the rule according to the EXPECTED_RULE_FORMAT shown in the 'Directed inlining rule must have the form ...' companion message","Strip anything after '#' only as comments; ensure the line has the form 'inline|dontinline : callerSpec -> ... -> calleeSpec'","Re-run and fix lines one at a time; each remaining error reports the next bad line"],"exampleFix":"# before (rules.txt:3)\ninline : com.foo.A.* ->\n\n# after (rules.txt:3)\ninline : com.foo.A.* -> com.bar.B.quad(int)","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    rules = DirectedInliningRules.fromFile(path);\n} catch (IllegalArgumentException e) {\n    // message is '<file>:<line>: <cause>' — log it and surface to the user editing the file\n    log.error(\"bad directed-inlining rule: {}\", e.getMessage());\n}","preventionTips":["Lint the rules file in CI with a dry parse before benchmark jobs","Use '#' as the only comment character and keep rules on single lines"],"tags":["graal","inlining","parsing","configuration"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}