Inspectopedia
 
2024.3

Labeled switch rule has redundant code block

Warning
New
Last modified: 03 December 2024

Reports labeled rules of switch statements or switch expressions that have a redundant code block.

Example:

After the quick-fix is applied:

This inspection depends on the Java feature 'Enhanced 'switch' blocks', which is available since Java 14.

New in 2019.1