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

By default bundled with:

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin:

Groovy, 241.14841

Last modified: 12 March 2024