Rule that checks unnecessary boolean expressions, including ANDing (&&) or ORing (||) with
true, false, null, or a Map/List/String/Number literal.
This rule also checks for negation (!) of true, false,
null, or a Map/List/String/Number literal.
Examples include:
def result = value && trueif (false || value) { .. }return value && Boolean.FALSEresult = value && "abc"result = null && valueresult = value && 123result = 678.123 || trueresult = value && [x, y]def result = [a:123] && valueresult = !trueresult = !falseresult = !Boolean.TRUEresult = !nullresult = !"abc"result = ![a:123]result = ![a,b]| Type | Name and description |
|---|---|
Class |
astVisitorClass |
String |
name |
int |
priority |