Affects PMD Version:6.51.0
Rule:ClassWithOnlyPrivateConstructorsShouldBeFinal
Please provide the rule name and a link to the rule documentation:
https://pmd.sourceforge.io/pmd-6.51.0/pmd_rules_java_design.html#classwithonlyprivateconstructorsshouldbefinal
Description:
Hi, I found a false positive about this rule, please read the following code example. PMD should not report a warning for this class because @NoArgsConstructor can add a constructor for this class. Hence, I think this is a false positive.
Code Sample demonstrating the issue:
import lombok.NoArgsConstructor;
@NoArgsConstructor
public class C {
private C(String[] arr, long in, String res) {}
}
Expected outcome:
PMD reports a violation at line 3, but that's wrong. That's a false positive.
Running PMD through: [Maven]
Affects PMD Version:6.51.0
Rule:ClassWithOnlyPrivateConstructorsShouldBeFinal
Please provide the rule name and a link to the rule documentation:
https://pmd.sourceforge.io/pmd-6.51.0/pmd_rules_java_design.html#classwithonlyprivateconstructorsshouldbefinal
Description:
Hi, I found a false positive about this rule, please read the following code example. PMD should not report a warning for this class because
@NoArgsConstructorcan add a constructor for this class. Hence, I think this is a false positive.Code Sample demonstrating the issue:
Expected outcome:
PMD reports a violation at line 3, but that's wrong. That's a false positive.
Running PMD through: [Maven]