Synopsis: | Avoid empty 'while' statements |
Language: | Java |
Severity Level: | 2 |
Category: | Basic |
Description: |
Empty While Statement finds all instances where a while statement
does nothing. If it is a timing loop, then you should use Thread.sleep() for it; if
it's a while loop that does a lot in the exit expression, rewrite it to make it clearer.public class Foo { void bar(int a, int b) { while (a == b) { // empty! } } } |