Inspectopedia Help

'break' statement

Reports break statements that are used in places other than at the end of a switch statement branch.

break statements complicate refactoring and can be confusing.

Example:

void foo(List<String> strs) { for (String str : strs) { if (str.contains("stop")) break; handleStr(str); } }

Inspection Details

By default bundled with:

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin:

Java, 241.16690

Last modified: 29 April 2024