Open kittech0 opened 12 months ago
I'm getting the exact same error when instanceof decomposition (Java 21 feature) is used
if (!(expression instanceof Expression(var operator, var operand))) {
throw new IllegalArgumentException("Invalid filter argument");
}
And I get a similar exception when using JDK21 anonymous variables:
currentOffsets.computeIfAbsent(partition, _ -> new AtomicLong()).set(consumerRecord.offset());
generates
com.palantir.javaformat.java.FormatterException: 156:60: error: expected token: '_'; generated instead -> [Help 1]
Tested with palantir-java-format 2.39.0
also in switch case this makes the formatter fail: case null, default
error: expected token: 'default'; generated - instead
edit: just realised this is also a type of pattern matching
palantir-java-format doesn't match new tokens in JDK 21