Statement Bodies Missing Braces


While java allows block statements without braces, the chance of making mistakes increases if braces are not used. For example when adding a new statement inside such a block, the fact that braces are missing is easily overlooked.
This codecheck generates a warning/error when these braces are omitted.

Since 0.6


Bad code:

Good code:

if (positiveInteger < 0)
if (positiveInteger < 0) {

Available quick fixes

The quick fix for this code check adds braces around the selected block statement.