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:
In the following code example, @Value can add a final modifier to the class Test and causes a false positive that PMD considers it is a class with only private constructors but no final modifier.
Code Sample demonstrating the issue:
import lombok.Value;
@Value
public class Test {
private Test(int a, int b, int c, String abc, long d, double p, String[] arr, int data, long in, float fl, String res) {}
}
Expected outcome:
PMD reports a violation at line 4, but that's wrong. That's a false positive.
Running PMD through: CLI
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:
In the following code example,
@Valuecan add afinalmodifier to the classTestand causes a false positive that PMD considers it is a class with only private constructors but nofinalmodifier.Code Sample demonstrating the issue:
Expected outcome:
PMD reports a violation at line 4, but that's wrong. That's a false positive.
Running PMD through: CLI