Inspectopedia Help

If statement with identical branches

Reports if statements with identical "then" and else branches. Such statements are almost certainly programmer error.


if (condition) { print "foo" } else { print "foo" }

After the quick-fix is applied:

print "foo"

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3


Groovy, 233.SNAPSHOT

Last modified: 13 July 2023