Back to Intellij Community

UnusedLabel

java/java-impl/resources/inspectionDescriptions/UnusedLabel.html

2025.3-rc-2314 B
Original Source

Reports labels that are not targets of any break or continue statements.

Example:

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

After the quick-fix is applied, the label is removed:

for (int i = 0; i < 10; i++) {
    if (i == 3) {
      break;
    }
  }