Fix: <enum>::values() is a static method, was not static#4417
Merged
jlerbsc merged 2 commits intojavaparser:masterfrom May 10, 2024
Merged
Fix: <enum>::values() is a static method, was not static#4417jlerbsc merged 2 commits intojavaparser:masterfrom
jlerbsc merged 2 commits intojavaparser:masterfrom
Conversation
jlerbsc
reviewed
May 7, 2024
| @Override | ||
| public boolean isStatic() { | ||
| return false; | ||
| return true; |
Collaborator
There was a problem hiding this comment.
Can you identify the corresponding section in the JLS?
Contributor
Author
There was a problem hiding this comment.
Hi,
the section is jls-8.9.3-100-D.
see:
Java 8: https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.9.3-100-D
Java 22: https://docs.oracle.com/javase/specs/jls/se22/html/jls-8.html#jls-8.9.3-100-D
Collaborator
|
I can't see anything to indicate that all the methods are static, even though that's what your modification is about. I haven't done a more precise test but I'm not sure that Javaparser supports implicit methods. |
Collaborator
|
Your PR seems correct. Sorry, I didn't read it properly. |
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.
Hi everyone,
while working with enums, I noticed that javaparser recognices ::values() as a not static method.
This pull request fixes this bug and adds an additional test.
Best regards
Kim