Rule Set: AccessorMethodGeneration (Java - Design), PMD 5.5.5
Description:
It appears that the rule AccessorMethodGeneration fails to resolve name clash with public field in another class with identical name.
Code Sample demonstrating the issue:
public class ClassA {
public String field;
}
public class ClassB {
private String field;
private class ClassC {
public void doSomething() {
ClassA a = new ClassA();
a.field = "abcd"; // should not be a violation here but reported as one
}
}
}
Changing ClassB#field to e.g. ClassB#field0 removes the violation.
Running PMD through: Gradle
Rule Set: AccessorMethodGeneration (Java - Design), PMD 5.5.5
Description:
It appears that the rule AccessorMethodGeneration fails to resolve name clash with public field in another class with identical name.
Code Sample demonstrating the issue:
Changing
ClassB#fieldto e.g.ClassB#field0removes the violation.Running PMD through: Gradle