Inspectopedia Help

Unnecessary label on 'break' statement

Reports break statements with unnecessary labels. Such labels do not change the control flow but make the code difficult to follow.

Example:

label: for(int i = 0; i < 10; i++) { if (shouldBreak()) break label; //doSmth }

After the quick-fix is applied:

label: for(int i = 0; i < 10; i++) { if (shouldBreak()) break; //doSmth }

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023