Affects PMD Version:
6.7.0
Rule:
LinguisticNaming
Description:
Predicates can be stored in fields or local variables to reduce lambda or method reference allocations, and often use boolean-style naming prefixes ("is", "has", etc.) like a boolean-returning method. Methods with this naming scheme are fine, but predicates (and relations such as BiPredicate
) trigger the rule.
It may be best to add a property to allow custom predicate-like types to pass the rule as well, since there may be interfaces in use like this:
interface Filter<T> { boolean passes(T value); }
Code Sample demonstrating the issue:
private final Predicate<String> isEmpty = String::isEmpty;
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