oracle/graal · error · IllegalArgumentException
expected phase_name=filter pair in: {}
Error message
expected phase_name=filter pair in: {} What it means
PhaseFilterKey.parse (PhaseFilterKey.java:113) splits the filter specification on ':' into phase-name/graph-filter pairs. When a part contains '=' but does not split into exactly two pieces, it throws this IllegalArgumentException. Example bad input: "Phase=a=b".
Source
Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/PhaseFilterKey.java:113
}
}
/**
* Creates a phase filter based on a specification string. The string is a colon-separated list
* of phase names or {@code phase_name=filter} pairs. Phase names match any phase of which they
* are a substring. Filters follow {@link MethodFilter} syntax.
*/
private static BasePhase.PhaseFilter parse(String specification, String phaselessGraphFilterToken) {
EconomicMap<Pattern, GraphFilter> filters = EconomicMap.create();
String[] parts = specification.trim().split(":");
GraphFilter phaselessGraphFilter = null;
for (String part : parts) {
String phaseName;
GraphFilter graphFilter;
if (part.contains("=")) {
String[] pair = part.split("=");
if (pair.length != 2) {
throw new IllegalArgumentException("expected phase_name=filter pair in: " + part);
}
phaseName = pair[0];
graphFilter = new GraphFilter(pair[1]);
} else {
phaseName = part;
graphFilter = new GraphFilter(null);
}
if (phaseName.equals(phaselessGraphFilterToken)) {
phaselessGraphFilter = graphFilter;
} else {
Pattern phasePattern = Pattern.compile(".*" + MethodFilter.createGlobString(phaseName) + ".*");
filters.put(phasePattern, graphFilter);
}
}
return new BasePhase.PhaseFilter(filters, phaselessGraphFilter);
}
}
View on GitHub (pinned to a66e9ccd1d)
Solutions
- Correct the spec so each part has at most one '=': phaseName=filter pairs separated by ':'
- Escape or remove '=' characters from the graph filter pattern
- Re-read the option's javadoc/usage text, which shows the expected 'phase_name=filter' form
Example fix
# before -Dgraal.PhaseFilter="Escape*=*all=methods" # after -Dgraal.PhaseFilter="Escape*=*allmethods"
Defensive patterns
Strategy: validation
Validate before calling
static void checkPhaseFilter(String spec) {
for (String part : spec.split(":")) {
int eq = part.indexOf('=');
if (eq >= 0 && part.indexOf('=', eq + 1) >= 0) throw new IllegalArgumentException("multiple '=' in: " + part);
}
} Prevention
- Keep exactly one '=' per colon-separated part
- Avoid '=' characters inside glob filters
When it happens
Trigger: A filter spec where one colon-separated part contains more than one '=', e.g., -Dgraal.PhaseFilter="Loop*=foo=bar"; also triggered by a glob pattern that itself contains '='.
Common situations: Typos in the option string; forgetting the MethodFilter glob syntax and using '=' inside the graph filter portion.
Related errors
- Value for {} cannot be empty
- Invalid directed inlining rules file path: {path}
- Could not read directed inlining rules file: {path}
- {file}:{line}: {cause}
- Directed inlining rule must have non-empty caller and callee
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/4e50d0a4f947a727.
Report an issue: GitHub.