Skip to content

Fix: <enum>::values() is a static method, was not static#4417

Merged
jlerbsc merged 2 commits intojavaparser:masterfrom
Kimmmey:fix-enum-values-to-be-static
May 10, 2024
Merged

Fix: <enum>::values() is a static method, was not static#4417
jlerbsc merged 2 commits intojavaparser:masterfrom
Kimmmey:fix-enum-values-to-be-static

Conversation

@Kimmmey
Copy link
Copy Markdown
Contributor

@Kimmmey Kimmmey commented May 7, 2024

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

@Override
public boolean isStatic() {
return false;
return true;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you identify the corresponding section in the JLS?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jlerbsc
Copy link
Copy Markdown
Collaborator

jlerbsc commented May 9, 2024

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.

@jlerbsc
Copy link
Copy Markdown
Collaborator

jlerbsc commented May 10, 2024

Your PR seems correct. Sorry, I didn't read it properly.

@jlerbsc jlerbsc merged commit bd5ddb5 into javaparser:master May 10, 2024
@jlerbsc jlerbsc added this to the next release milestone May 10, 2024
@jlerbsc jlerbsc added the PR: Fixed A PR that offers a fix or correction label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Fixed A PR that offers a fix or correction

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants