{"record":{"id":"229bfa12e868b06b","repo":"oracle/graal","slug":"value-for-cannot-be-empty","errorCode":null,"errorMessage":"Value for {} cannot be empty","messagePattern":"Value for (.+?) cannot be empty","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/PhaseFilterKey.java","lineNumber":81,"sourceCode":"                    A phase name is matched as a substring.\n\n                    For example:\n\n                       PartialEscape:Loop=B.foo,A.*\n\n                    matches PartialEscapePhase for compilation of all methods and any phase\n                    containing \"Loop\" in its name for compilation of B.foo as well as all\n                    methods in class A.\n\n                    A phase filter specification cannot be empty. Specify \"*\" to match\n                    any phase.\"\"\";\n\n    private final ConcurrentHashMap<String, BasePhase.PhaseFilter> parsedValues = new ConcurrentHashMap<>();\n\n    @Override\n    protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, String oldValue, String newValue) {\n        if (newValue != null && newValue.isEmpty()) {\n            throw new IllegalArgumentException(\"Value for \" + getName() + \" cannot be empty\");\n        }\n    }\n\n    /**\n     * Determines whether {@code phase} when applied to {@code graph} is matched by {@code filter}.\n     */\n    public boolean matches(OptionValues options, BasePhase<?> phase, StructuredGraph graph) {\n        String filter = getValue(options);\n        if (filter == null) {\n            return false;\n        } else {\n            GraalError.guarantee(phase != null || phaselessGraphFilterToken != null, \"Cannot pass null phase unless phaselessGraphFilterToken is non-null\");\n            return parsedValues.computeIfAbsent(filter, f -> PhaseFilterKey.parse(f, phaselessGraphFilterToken)).matches(phase, graph);\n        }\n    }\n\n    /**\n     * Creates a phase filter based on a specification string. The string is a colon-separated list","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/PhaseFilterKey.java#L63-L99","documentation":"PhaseFilterKey is the OptionKey for the graal phase filter option (e.g., -Dgraal.PhaseFilter). Its onValueUpdate hook (PhaseFilterKey.java:81) rejects an empty string because an empty filter matches nothing and is almost certainly a configuration mistake. The docs say to use \"*\" to match any phase.","triggerScenarios":"Setting the option to an empty value, e.g., -Dgraal.PhaseFilter=\"\" or programmatically new OptionValues(..., PhaseFilterKey, \"\") — the IllegalArgumentException is thrown at option-update time.","commonSituations":"Scripts that build the option string from an unset environment variable, producing -Dgraal.PhaseFilter=; CI configs that template the flag with an empty default.","solutions":["Remove the -Dgraal.<PhaseFilter>= flag entirely if no filtering is wanted","Use \"*\" if the intent is to match all phases","Fix the script/CI template so an unset variable omits the flag instead of emitting an empty value"],"exampleFix":"# before\njava -Dgraal.PrintFilters=\"$PHASE_FILTER\" App  # empty env var\n\n# after\nPHASE_FILTER=\"*\" java -Dgraal.PrintFilters=\"$PHASE_FILTER\" App","handlingStrategy":"validation","validationCode":"String filter = System.getenv().getOrDefault(\"PHASE_FILTER\", \"*\");\nassert !filter.isEmpty() : \"phase filter must not be empty; use '*'\";\n// then: -Dgraal.<PhaseFilterOption>=\" + filter","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default templated option values to '*' or omit the flag, never to empty string","Smoke-test launcher scripts with all env vars unset"],"tags":["graal","options","configuration","phase-filter"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}