Inspectopedia Help

Duplicate switch case

Reports duplicated expressions in case labels for switch statements.

Example:

switch (n) { case 1: //duplicate break case 1: //duplicate System.out.println("2") break default: System.out.println("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