title: Klockwork warning: Null pointer dereference of where null is returned from a method
body: <p>While doing bug analysis using klocwork, I am getting warning <code>Null pointer dereference of 'nextLineDn' where null is returned from a method</code>. </p>
  
  <p>Apparently other static analysis tool <code>findbug</code> also gives same warning. </p>
  
  <p>But clearly i am checking for null/empty before using it.  </p>
  
  <pre><code>      int noOfLines = device.getLines().size();     
          if( lineNo != 0 &amp;&amp; noOfLines &gt; lineNo ) // if next line exists      
          {   
              nextLineDn = device.getDn(lineNo+1);    
              if(!Util.isNullOrEmpty(nextLineDn)) 
              {       
                  return (nextLineDn.contains("@")) ? nextLineDn.split("@")[0] : nextLineDn;  
              }       
          }
  </code></pre>
  
  <p><code>class Util</code> :</p>
  
  <pre><code>public static boolean isNullOrEmpty(String str) {
      return (str == null || str.isEmpty());
  }
  </code></pre>
  
  <p>can someone give me some idea on this? 
  i am getting so many warning with same conditions.Dont know what else can be done to remove the warning.</p>