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
PMD.AvoidAccessToStaticMembersViaThis check works incorrectly #1197
Comments
BTW, using |
@yegor256 Could you help here, please? |
@volodya-lombrozo it seems i found the cause of the problem - in the end of HasMethod.java there is a nested static class with
|
Rule AvoidAccessToStaticMembersViaThis get all methods from the file, not from the class body. It is the reason for bug. |
I have the following Java code in HasMethod.java:
When I run
mvn qulice:check -Pqulice
with version0.22.1
, I'm getting the following error:[INFO] PMD: src/test/java/org/eolang/jeo/representation/directives/HasMethod.java[113-113]: Static members should be accessed in a static way [CLASS_NAME.FIELD_NAME], not via instance reference. (AvoidAccessToStaticMembersViaThis)
It's rather strange because the
checks()
is an instance method, not a static member:I've tried to find the description of the
AvoidAccessToStaticMembersViaThis
check in PMD and failed. Maybe this check somehow related toqulice
?The text was updated successfully, but these errors were encountered: