Back to Intellij Community

GroovyIfStatementWithIdenticalBranches

plugins/groovy/groovy-psi/resources/inspectionDescriptions/GroovyIfStatementWithIdenticalBranches.html

2025.3-rc-2254 B
Original Source

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

Example:

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

After the quick-fix is applied:

print "foo"