Back to Intellij Community

SingleStatementInBlock

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

2025.3-rc-2313 B
Original Source

Reports control flow statements with a single statement in their code block and suggests removing the braces from the control flow statement body.

Example:

if (x > 0) {
    System.out.println("x is positive");
  }

After the quick-fix is applied:

if (x > 0) System.out.println("x is positive");