{"record":{"id":"e671fb4ec6cdf7c0","repo":"oracle/graal","slug":"invalid-double-value-s-e671fb","errorCode":null,"errorMessage":"invalid double value: \"%s\"","messagePattern":"invalid double value: \"(.+?)\"","errorType":"validation","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/util/args/IntegerValue.java","lineNumber":48,"sourceCode":"public class IntegerValue extends OptionValue<Integer> {\n    public IntegerValue(String name, String help) {\n        super(name, help);\n    }\n\n    public IntegerValue(String name, Integer defaultValue, String help) {\n        super(name, defaultValue, help);\n    }\n\n    @Override\n    public boolean parseValue(String arg) throws InvalidArgumentException {\n        if (arg == null) {\n            throw new InvalidArgumentException(getName(), \"no value provided\");\n        }\n        try {\n            value = Integer.valueOf(arg);\n            return true;\n        } catch (NumberFormatException e) {\n            throw new InvalidArgumentException(getName(), String.format(\"invalid double value: \\\"%s\\\"\", arg));\n        }\n    }\n}\n","sourceCodeStart":30,"sourceCodeEnd":52,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/util/args/IntegerValue.java#L30-L52","documentation":"Thrown by IntegerValue.parseValue when the string supplied for an integer-valued option cannot be parsed by Integer.valueOf. It is wrapped in InvalidArgumentException so the option framework can report which option name failed. Note the message text says 'invalid double value' even though the value is parsed as an int — a copy-paste wording bug in the source.","triggerScenarios":"Calling parseValue(arg) on an IntegerValue (e.g. via the args framework parsing a command line or test harness) with a string like \"1.5\", \"abc\", an empty string, or a value outside int range; NumberFormatException is caught and rethrown as InvalidArgumentException.","commonSituations":"Passing a floating-point number where an int option is expected (e.g. -D:SomeInt=3.5), trailing whitespace or quotes in the value, hex/underscores not supported by Integer.valueOf, or hitting the int overflow range on a value that looks valid.","solutions":["Correct the value to be a valid base-10 int (no decimal point, no whitespace): e.g. pass 3 instead of 3.5","If a fractional value is intended, use the double-based option type instead of IntegerValue","Trim/validate the string before it reaches the option parser (shell quoting, config files)","As a contributor, fix the misleading message in IntegerValue.java:48 to say 'invalid integer value'"],"exampleFix":"# before\n-D:GraalCompileQueueSize=1.5   -> InvalidArgumentException: invalid double value: \"1.5\"\n\n# after\n-D:GraalCompileQueueSize=2","handlingStrategy":"validation","validationCode":"if (arg == null || !arg.matches(\"[+-]?\\\\d+\")) {\n    throw new InvalidArgumentException(name, \"value must be a base-10 int, got: \" + arg);\n}","typeGuard":null,"tryCatchPattern":"catch (InvalidArgumentException e) { report option name + raw value; do not retry with the same string }","preventionTips":["Validate numeric strings with a regex/range check before parseValue","Quote option values in scripts to avoid shell splitting","Prefer the double option type when fractional inputs are legal"],"tags":["graalvm","options","parsing","configuration"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}