Inspectopedia Help

Enhanced 'switch'

Reports enhanced switch statements and expressions. Suggests replacing them with regular switch statements.


boolean even = switch (condition) { case 1, 3, 5, 7, 9 -> false; default -> true; };

After the quick-fix is applied:

boolean even; switch (condition) { case 1: case 3: case 5: case 7: case 9: even = false; break; default: even = true; break; }

Locating this inspection


Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | Java | Java language level migration aids | Java 14

Enhanced switch appeared in Java 14. This inspection can help to downgrade for backward compatibility with earlier Java versions.

New in 2019.1


By default bundled with

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin

Java, 241.18072

Last modified: 18 June 2024