Affects PMD Version: 5.8.1, 6.0.0 (and probably 5.5.4 upwards since the rule was introduced)
Rule: AccessorMethodGeneration
Description: overloaded method tricks the rule into thinking there will be an accessor method generated.
Code Sample demonstrating the issue:
@SuppressWarnings({"unused", "StaticMethodOnlyUsedInOneClass", "SameParameterValue", "PMD.UseUtilityClass"})
class Outer {
static void outerMethod(int i) {
// package private method, safe to call, and is called from Inner.f()
}
private static void outerMethod(String s) {
// private method, not used anywhere, yet triggers AccessorMethodGeneration
}
static class Inner {
void f() {
outerMethod(0);
}
}
}
Running PMD through: Gradle (5.8.1) and CLI (6.0.0 pmd -d . -format text -R java-design)
Affects PMD Version: 5.8.1, 6.0.0 (and probably 5.5.4 upwards since the rule was introduced)
Rule:
AccessorMethodGenerationDescription: overloaded method tricks the rule into thinking there will be an accessor method generated.
Code Sample demonstrating the issue:
Running PMD through: Gradle (5.8.1) and CLI (6.0.0
pmd -d . -format text -R java-design)