title: Got Findbugs issue “NP_NULL_ON_SOME_PATH” when null test is in a separate method. Is this a false alarm?
body: <p>I have some code which is similar to the following snippet:</p>
  
  <pre><code>public void foo(Order o) {
      ...
      checkInput(o, "some error message");
      doSomehing(o.getId());
  }
  
  private void checkInput(Object o, String message) {
      if (o == null) {
          throw new SomeRuntimeException(message);
      }
  }
  </code></pre>
  
  <p>And I got Findbugs reporting an 'NP_NULL_ON_SOME_PATH' issue.</p>
  
  <p>Here is the description:</p>
  
  <p><code>There is a branch of statement that, if executed, guarantees that a null value will be dereferenced, which would generate a NullPointerException when the code is executed. Of course, the problem might be that the branch or statement is infeasible and that the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs.</code></p>
  
  <p>My questions are:</p>
  
  <ol>
  <li>Can I treat it as a false positive in this example?</li>
  <li>Is it a good practice to put the null test in a separate method? The actual null check method is a bit longer than the sample method so I don't want to repeat the code everywhere.</li>
  </ol>
  
  <p>Thanks!</p>