Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use getDeclaredClass on Enum #21

Open
tkoeppe opened this issue May 20, 2021 · 0 comments
Open

Use getDeclaredClass on Enum #21

tkoeppe opened this issue May 20, 2021 · 0 comments

Comments

@tkoeppe
Copy link
Contributor

tkoeppe commented May 20, 2021

I don't know Java well, so I'd just like to leave this as a suggestion, without judgement:

Our static analysis suggests a change at https://github.com/qmx/jitescript/blob/master/src/main/java/me/qmx/jitescript/VisibleAnnotation.java#L34, to change value.getClass() to value.getDeclaredClass(). The former returns some derived class for enums that declare methods, whereas the latter returns the actual enum type.

I'm not sure if that's correct, but it was flagged as an error-prone pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant