Affects PMD Version:
6.39.0
Rule:
UnusedPrivateField
Please provide the rule name and a link to the rule documentation:
https://pmd.github.io/latest/pmd_rules_java_bestpractices.html#unusedprivatefield
Description:
Hi, I think PMD should have reported a violation warning at line 5, but it does not. Actually, the method func is a unused private method. Hence, I think it is a false negative. I am happy to help fix this issue. Thanks for your consideration and help.
Code Sample demonstrating the issue:
class Impl {
enum EnumClass {
FOO;
EnumClass() {}
private void func(){}; // should report a warning here
}
}
Expected outcome:A warning
PMD should report a violation at line 5, but doesn't. This is a false-negative.
Running PMD through: [Maven]
Affects PMD Version:
6.39.0
Rule:
UnusedPrivateField
Please provide the rule name and a link to the rule documentation:
https://pmd.github.io/latest/pmd_rules_java_bestpractices.html#unusedprivatefield
Description:
Hi, I think PMD should have reported a violation warning at line 5, but it does not. Actually, the method
funcis a unused private method. Hence, I think it is a false negative. I am happy to help fix this issue. Thanks for your consideration and help.Code Sample demonstrating the issue:
Expected outcome:A warning
PMD should report a violation at line 5, but doesn't. This is a false-negative.
Running PMD through: [Maven]