Closed volodya-lombrozo closed 8 months ago
BTW, using @SuppressWarnings("PMD.AvoidAccessToStaticMembersViaThis")
helps to avoid the qulice
complaint.
@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 static Stream<String> checks()
method, and qulice take into account all method declarations named as checks()
. I'll see what i can do about it.
private static final class HasLabel {
/**
* Checks of label.
* @param root Root Method XPath.
* @return List of XPaths to check.
*/
static Stream<String> checks(final String root) {
return Stream.of(
String.format(
"%s/o[@base='seq']/o[@base='tuple']/o[@base='label' and @data='bytes']/@data",
root
)
);
}
}
Rule AvoidAccessToStaticMembersViaThis get all methods from the file, not from the class body. It is the reason for bug. Will ask in pmd how to avoid warning messages and will fix the rule to get only current class methods
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: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
?