Affects PMD Version:7.0.0-rc1
Rule: FinalFieldCouldBeStatic
Please provide the rule name and a link to the rule documentation:
https://docs.pmd-code.org/latest/pmd_rules_java_design.html#finalfieldcouldbestatic
Description:@UtilityClass
will make the field static so that the final field BAR becomes a static field. However, PMD reports a warning because PMD does not consider the annotation @UtilityClass
Code Sample demonstrating the issue:
import lombok.experimental.UtilityClass; @UtilityClass public class Test { public final String BAR = "42"; // report a warning }
Expected outcome:
PMD reports a violation at line 4, but that's wrong. That's a false positive.
Running PMD through: CLI
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4