title: javax.annotation.Nonnull vs assert
body: <p>I'm using Findbugs and javax.annotation.Nonnull on method parameters.</p>
  
  <p>On private methods I usually add an assert line to check for nullness like</p>
  
  <pre><code>private void myMethod(@Nonnull String str) {
      assert str != null
      ....
  </code></pre>
  
  <p>Latest Netbeans version (7.3rc2) is reporting that the assert check is not necessary (because of the Nonnull annotation). I'm not fully sure this is a Netbeans bug or not.</p>
  
  <p>Can the assert line be removed because I specified the @Nonnull annotation ?</p>
  
  <p>As far as I understand, the annotation is used only during static analysis while assert is, when enabled, active during execution so the twos are not alternative.</p>