{"record":{"id":"49c1dadb73a2c8c9","repo":"oracle/graal","slug":"no-value-provided-49c1da","errorCode":null,"errorMessage":"no value provided","messagePattern":"no value provided","errorType":"validation","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/util/args/StringValue.java","lineNumber":42,"sourceCode":" */\npackage jdk.graal.compiler.util.args;\n\n/**\n * \"Parses\" (effectively returns unaltered) a {@link String} from command line arguments.\n */\npublic class StringValue extends OptionValue<String> {\n    public StringValue(String name, String help) {\n        super(name, help);\n    }\n\n    public StringValue(String name, String 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        value = arg;\n        return true;\n    }\n}\n","sourceCodeStart":24,"sourceCodeEnd":48,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/util/args/StringValue.java#L24-L48","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Supply an explicit value for the option, including an empty string if that is intended: -D:MyOpt= rather than omitting the value","If the option is optional, guard the call: only parse when the raw value is non-null","Check the upstream arg-splitting logic if '=value' segments are being dropped"],"exampleFix":"// before\nStringValue opt = new StringValue(\"Filter\", \"help\");\nopt.parseValue(map.get(\"Filter\"));   // map lacks key -> null -> InvalidArgumentException\n\n// after\nString raw = map.get(\"Filter\");\nif (raw != null) {\n    opt.parseValue(raw);\n}","handlingStrategy":"validation","validationCode":"if (raw == null) {\n    // omit or use an explicit empty string\n    raw = \"\";\n}","typeGuard":null,"tryCatchPattern":"catch (InvalidArgumentException e) { treat as missing option and apply a program-level default }","preventionTips":["Null-check config/map lookups before forwarding to parseValue","Use empty string (not absence) when 'set but blank' is intended","Keep the args splitter from producing null for '=value' forms"],"tags":["graalvm","options","parsing","null-safety"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}