E540 Fix: <enum>::values() is a static method, was not static by Kimmmey · Pull Request #4417 · javaparser/javaparser · GitHub
[go: up one dir, main page]

Skip to content

Conversation

Kimmmey
Copy link
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
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
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
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
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
0