Inspectopedia Help

Fallthrough in 'switch' statement

Reports fallthrough in switch statements. While occasionally useful, fallthrough is often unintended, and may lead to surprising bugs.

Example:

switch(n) { case 1: print 1 case 2: // "case 1" fallthrough to "case 2". Statements from "case 2" will be executed immediately after "case 1". print 2 break default: print "Default" }

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Groovy, 233.SNAPSHOT

Last modified: 13 July 2023