oracle/graal · error · InvalidArgumentException

no value provided

Error message

no value provided

What it means

Thrown by StringValue.parseValue when the argument is null. Unlike MultiChoiceValue (which resets to its default on null) or numeric values, a StringValue has no meaningful null handling, so the caller must always supply an actual string, even an empty one.

Source

Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/util/args/StringValue.java:42

 */
package jdk.graal.compiler.util.args;

/**
 * "Parses" (effectively returns unaltered) a {@link String} from command line arguments.
 */
public class StringValue extends OptionValue<String> {
    public StringValue(String name, String help) {
        super(name, help);
    }

    public StringValue(String name, String 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");
        }
        value = arg;
        return true;
    }
}

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Supply an explicit value for the option, including an empty string if that is intended: -D:MyOpt= rather than omitting the value
  2. If the option is optional, guard the call: only parse when the raw value is non-null
  3. Check the upstream arg-splitting logic if '=value' segments are being dropped

Example fix

// before
StringValue opt = new StringValue("Filter", "help");
opt.parseValue(map.get("Filter"));   // map lacks key -> null -> InvalidArgumentException

// after
String raw = map.get("Filter");
if (raw != null) {
    opt.parseValue(raw);
}
Defensive patterns

Strategy: validation

Validate before calling

if (raw == null) {
    // omit or use an explicit empty string
    raw = "";
}

Try / catch

catch (InvalidArgumentException e) { treat as missing option and apply a program-level default }

Prevention

When it happens

Trigger: Invoking parseValue(null) on a StringValue — typically the args framework forwarding a missing value after '=' (e.g. '-D:Opt=' parsed to null) or a test/harness explicitly passing null.

Common situations: A command line that specifies the option name but no value (-D:MyStringOpt with nothing after the separator), a config map lookup returning null that is forwarded unchecked, or a refactor where a default of null replaced an empty string.

Related errors


AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14). Data as JSON: /api/errors/49c1dadb73a2c8c9. Report an issue: GitHub.