{"record":{"id":"1a0236c0069f36eb","repo":"oracle/graal","slug":"the-argument-s-could-not-be-parsed-s","errorCode":null,"errorMessage":"The argument '%s' could not be parsed: %s","messagePattern":"The argument '(.+?)' could not be parsed: (.+?)","errorType":"validation","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/org.graalvm.profdiff/src/org/graalvm/profdiff/args/DoubleArgument.java","lineNumber":40,"sourceCode":" * or visit www.oracle.com if you need additional information or have any\n * questions.\n */\npackage org.graalvm.profdiff.args;\n\n/**\n * A program argument that holds a double.\n */\npublic class DoubleArgument extends ValuedArgument<Double> {\n    public DoubleArgument(String name, double defaultValue, String help) {\n        super(name, defaultValue, help);\n    }\n\n    @Override\n    protected Double parseValue(String s) throws InvalidArgumentException {\n        try {\n            return Double.parseDouble(s);\n        } catch (NumberFormatException e) {\n            throw new InvalidArgumentException(getName(), e.getMessage());\n        }\n    }\n}\n","sourceCodeStart":22,"sourceCodeEnd":44,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/org.graalvm.profdiff/src/org/graalvm/profdiff/args/DoubleArgument.java#L22-L44","documentation":"Thrown by DoubleArgument.parseValue when Double.parseDouble raises NumberFormatException; the JDK message (e.g. 'For input string: \"abc\"') is chained into InvalidArgumentException. It marks a numeric option that received something that is not a parsable IEEE double.","triggerScenarios":"Passing '--some-double=abc', '--some-double=1,5' (comma decimal separator from a locale), an empty string, or 'NaN-like' text that Double.parseDouble rejects, to any double-valued option registered in a profdiff-style parser.","commonSituations":"Locale-related decimal separators ('1,5' vs '1.5'), trailing units ('0.5x'), empty CI variables, or copy-paste of percentages like '50%'.","solutions":["Provide a plain dot-decimal number, e.g. '1.5', with no units or thousand separators.","If the value comes from a locale-aware tool, convert ',' to '.' before passing it.","Validate the value with Double.parseDouble in your script before invoking the command."],"exampleFix":"# before\nmx profdiff ... --cur-decimals 2,5\n# after\nmx profdiff ... --cur-decimals 2.5","handlingStrategy":"validation","validationCode":"Double d;\ntry { d = Double.parseDouble(value); } catch (NumberFormatException e) { throw new IllegalArgumentException(\"Not a double: \" + value); }","typeGuard":"static boolean isParsableDouble(String s) {\n    if (s == null || s.isEmpty()) return false;\n    try { Double.parseDouble(s); return true; } catch (NumberFormatException e) { return false; }\n}","tryCatchPattern":"try {\n    parser.parse(args);\n} catch (InvalidArgumentException e) {\n    // message contains the JDK NumberFormatException text; correct the numeric option\n}","preventionTips":["Use dot as the decimal separator.","No units, no thousands separators, no percent signs in numeric values."],"tags":["cli","arguments","number-parsing","locale"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}