title: Redundant nullcheck of value known to be non-null or possible bug in findbugs
body: <p>Here is the code:</p>
  
  <pre><code>public static String readFile(InputStream is) {
  
          try (Scanner scanner = new Scanner(is); Scanner delimitedScanner = scanner.useDelimiter("\\A");) {
              return scanner.hasNext() ? scanner.next() : "";
          }
      }
  </code></pre>
  
  <p>And findbugs plugin says:</p>
  
  <blockquote>
    <p>Redundant nullcheck of value known to be non-null This method contains
    a redundant check of a known non-null value against the constant nul</p>
  </blockquote>
  
  <p>And points on this:</p>
  
  <pre><code>return scanner.hasNext() ? scanner.next() : "";
          } //this line contains bug!!!
      }
  </code></pre>
  
  <p>Look at the pic:</p>
  
  <p><a href="https://i.stack.imgur.com/ubQXc.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ubQXc.png" alt="enter image description here"></a></p>
  
  <p>And eclipse shows the same warning:</p>
  
  <p><a href="https://i.stack.imgur.com/66cHv.png" rel="noreferrer"><img src="https://i.stack.imgur.com/66cHv.png" alt="enter image description here"></a></p>