Affects PMD Version: 6.52.0
Rule: MissingStaticMethodInNonInstantiatableClass
Please provide the rule name and a link to the rule documentation:
https://pmd.github.io/latest/pmd_rules_java_errorprone.html#missingstaticmethodinnoninstantiatableclass
Description:
Issue #4224 fixed false-negative problem of omitting Lombok's @UtilityClass from being verified at all, but introduced problems for utility classes that contain only field members. Actually, we should check whether a class has both private fields only AND private methods only.
Code Sample demonstrating the issue:
@UtilityClass public final class Test { public static final String CONSTANT = "Constant"; }
Expected outcome:
PMD reports a violation at line 3, but that's wrong. That's a false positive.
Running PMD through: Gradle
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