Finds nested blocks.
For example this Check flags confusing code like
public void guessTheOutput()
{
int whichIsWich = 0;
{
int whichIsWhich = 2;
}
System.out.println("value = " + whichIsWhich);
}
and debugging / refactoring leftovers such as
// if (someOldCondition)
{
System.out.println("unconditional");
}
A case in a switch statement does not implicitly form a block.
Thus to be able to introduce local variables that have case scope
it is necessary to open a nested block. |