Fix NoSuchMethodError happening on JDK 21 (fixes #885)#886
Merged
fawind merged 1 commit intopalantir:developfrom Jun 20, 2023
Merged
Fix NoSuchMethodError happening on JDK 21 (fixes #885)#886fawind merged 1 commit intopalantir:developfrom
fawind merged 1 commit intopalantir:developfrom
Conversation
Member
|
Thanks for your interest in palantir/palantir-java-format, @gnodet! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request. |
The JDK internal class JCImport has changed recently. In JDK 17, the method was defined as:
public JCTree getQualifiedIdentifier() { return qualid; }
and in JDK 21:
public JCFieldAccess getQualifiedIdentifier() { return qualid; }
One possibility to fix that would be to fix the getSimpleName() method to use an argument of type com.sun.source.tree.ImportTree and call the getQualifiedIdentifier() method which returns a com.sun.source.tree.Tree and has not changed.
aeae880 to
02dde30
Compare
fawind
approved these changes
Jun 20, 2023
Contributor
fawind
left a comment
There was a problem hiding this comment.
Makes sense, thanks for contibuting!
Contributor
|
Will take a look at getting the "Validation" action running on forks |
Collaborator
|
Released 2.33.0 |
|
Did not fix the problem for me: #885 (comment) |
Contributor
Author
Unfortunately, I have to agree here... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #885 for the full description of this issue.
The PR simply changed the argument to the interface so that the return type is not changed across JDKs.