palantir / palantir/palantir-java-format
Support for Java 21+ features -- unnamed variable
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 907
- Forks
- 101
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 19
Description
Using latest version: 2.89.0 (Java 25)
And seeing this:
[ERROR] KpiService.java:L34 toggle(toggle) error: expected token: '_'; generated , instead
On:
public List<KpiStatus> evaluateAll() {
return policyRegistry.policies().parallelStream()
.map(policy -> {
var result = redFetcher.fetch(policy);
return switch (result) {
case MetricResult.Available(var metrics) -> evaluator.evaluate(policy, metrics);
case MetricResult.Insufficient(_, var source, var reason) ->
new KpiStatus.Insufficient(policy, source, reason);
};
})
.toList();
}
Wasn't unnamed pattern supposed to work by now?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the report with the Java 25 switch-pattern snippet in the issue and the formatter version 2.89.0. Trace the parser or formatter path that reports the expected-token error for _; done means the example formats successfully without that error while preserving the unnamed pattern.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100