title: Why does the following code compile?
body: <p>I was wondering why this code snippet compiles and runs</p>
  
  <pre><code>private BusRoute readRouteCursor( final Cursor c )
  {
      final BusRoute result;
      final int count;
      if ( c == null || ( count = c.getCount() ) &lt; 1 )
      {
          result = null;
      }
      else
      {
          /*
           * Reads cursor
           */
      }
      return result;
  }
  </code></pre>
  
  <p>I have it working just fine but when I stopped to think about it I wondered why, as the variable <code>count</code> is <code>final</code> but it's possible for it not to be set if the first condition of the <code>if</code> clause is met.</p>
  
  <p>Does it work because the compiler is clever enough to see there are no uses of <code>count</code> from that point on, and it needn't be initialised at all?</p>