[java] ClassWithOnlyPrivateConstructorsShouldBeFinal should consider lombok's @Value #4200
Labels
a:false-positive
PMD flags a piece of code that is not problematic
Milestone
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 afinal
modifier to the classTest
and causes a false positive that PMD considers it is a class with only private constructors but nofinal
modifier.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
The text was updated successfully, but these errors were encountered: