title: Empty if-statements
body: <p>By "empty if-statement", I mean something like this (note the semicolon):</p>
  
  <pre><code>if (condition);
  </code></pre>
  
  <p>I'm having trouble thinking of an application for this. With a while loop you can do this:</p>
  
  <pre><code>while (callUntilReturnsFalse());
  </code></pre>
  
  <p>But there's no such application for an if-statement. What's more, the Java compiler doesn't issue an error or a warning when confronted with such a statement. This can lead to large and <em>silent</em> problems, especially with a long and convoluted statement:</p>
  
  <pre><code>if ((functionA() &amp;&amp; functionB(getFoo()) ||
      checkForComplexCondition(arg1, arg2, getBar(getFoo())));
  {
      doStuff();
  }
  </code></pre>
  
  <p>My question is: why is this allowed in Java? And, more importantly, can I enable an option to cause a warning when this happens?</p>
  
  <p>(This question was <a href="https://stackoverflow.com/questions/3544776/should-empty-if-statement-in-c-sharp-lead-to-an-error-or-warning">asked before</a> with regards to C#, which does issue a warning, but I was hoping to find a way to cause a warning with Java.)</p>