WhileLoopsMustUseBraces

Avoid using 'while' statements without using curly braces.

This rule is defined by the following XPath expression:


//WhileStatement[not(Statement/Block)]

                

Example:

                

public void doSomething() {
  while (true)
      x++;
}