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, based on the below code sample, I think PMD should report a wanrning at line 5, but it doesn't. However, variable a is a UnusedPrivateField, so I think it is a false negative. Thanks for your consideration and I am willing to help you fix this bug.
Code Sample demonstrating the issue:
class Test {
enum EnumClass {
subClass();
EnumClass() {}
private int a; // should report a warning here
}
}
Expected outcome: A violation 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, based on the below code sample, I think PMD should report a wanrning at line 5, but it doesn't. However, variable
ais a UnusedPrivateField, so I think it is a false negative. Thanks for your consideration and I am willing to help you fix this bug.Code Sample demonstrating the issue:
Expected outcome: A violation warning
PMD should report a violation at line 5, but doesn't. This is a false-negative.
Running PMD through: [Maven]