Conversation
|
@crogoz @felixdesouza @CRogers @FinlayRJW anything I can help you with ? |
|
@gnodet similar fix was also in google-java-format |
Ah, didn't check that one. Both should be fixed I suppose. |
|
They fixed it with a static variable, that may perform better |
|
The problem here is more that the team is not responsive at all... |
| try { | ||
| // Fall back to pre-JDK 25 method (Queue<JCDiagnostic>) | ||
| Method queueMethod = DeferredDiagnosticHandler.class.getMethod("getDiagnostics"); | ||
| return (Collection<JCDiagnostic>) queueMethod.invoke(handler); | ||
| } catch (Exception e2) { |
There was a problem hiding this comment.
I don't believe this particular change does anything? There is no difference between this and lines 480-482. It makes more sense to do the same/equivalent change as google-java-format: https://github.com/google/google-java-format/pull/1247/files.
There was a problem hiding this comment.
@felixdesouza You're right, I removed the second fallback which is completely useless.
I also cached the method handle in a static final field to get closer to google/google-java-format#1247. Just cherry-picking their commit could work too I suppose.
|
Any chance of seeing this merged/released soon? I'm starting to test our builds under J25ea and this was the first thing I hit. |
|
I've made another PR to apply this change at #1367 - just because some our changelog infra doesn't work well on forks (there's a fix in the works for it but not ready yet) |
|
Released as 2.71.0 |
…74.0 Current configuration yields `NoSuchMethodError` upon compilation when using java 25, which is now fixed in `palantir-java-format:2.71.0`: palantir/palantir-java-format#1305 That only change would be sufficient, but I updated the palantir version to `2.74.0` and also the spotless plugin to `3.0.0` to comply with this change in the original repo: feature-tracker@1e2fca6 Also fixes readme that still mentioned java 21 as prerequisite, when in fact it is now java 24.
…74.0 Current configuration yields `NoSuchMethodError` upon compilation when using java 25, which is now fixed in `palantir-java-format:2.71.0`: palantir/palantir-java-format#1305 That only change would be sufficient, but I updated the palantir version to `2.74.0` and also the spotless plugin to `3.0.0` to comply with this change in the original repo: feature-tracker@1e2fca6 Also fixes readme that still mentioned java 21 as prerequisite, when in fact it is now java 24. (cherry picked from commit 8118ef0)
Before this PR
The build fails with the following error when running on JDK 25
After this PR
The build works correctly
Possible downsides?
The commit uses reflection to call the correct method, but this is the only way to support the incompatible API change introduced in JDK 25 while still supporting older JDK.