oracle/graal · error · InvalidArgumentException
invalid double value: "%s"
Error message
invalid double value: "%s"
What it means
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.
Source
Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/util/args/IntegerValue.java:48
public class IntegerValue extends OptionValue<Integer> {
public IntegerValue(String name, String help) {
super(name, help);
}
public IntegerValue(String name, Integer defaultValue, String help) {
super(name, defaultValue, help);
}
@Override
public boolean parseValue(String arg) throws InvalidArgumentException {
if (arg == null) {
throw new InvalidArgumentException(getName(), "no value provided");
}
try {
value = Integer.valueOf(arg);
return true;
} catch (NumberFormatException e) {
throw new InvalidArgumentException(getName(), String.format("invalid double value: \"%s\"", arg));
}
}
}
View on GitHub (pinned to a66e9ccd1d)
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'
Example fix
# before -D:GraalCompileQueueSize=1.5 -> InvalidArgumentException: invalid double value: "1.5" # after -D:GraalCompileQueueSize=2
Defensive patterns
Strategy: validation
Validate before calling
if (arg == null || !arg.matches("[+-]?\\d+")) {
throw new InvalidArgumentException(name, "value must be a base-10 int, got: " + arg);
} Try / catch
catch (InvalidArgumentException e) { report option name + raw value; do not retry with the same string } Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- no choice named '%s'
- Delimiter '%s' is repeated contiguously in "%s"
- LIRInstructionVerifierPath is not supported in native image
- no value provided
- Option setting has does not match the pattern <name>=<value>
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/e671fb4ec6cdf7c0.
Report an issue: GitHub.