Menu

#1468 false-positive: NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE

3.x
closed-rejected
nobody
None
5
2017-10-22
2016-09-20
No

I've found a case where two simple examples produce different results. See https://github.com/slipcon/findbugs-bug

In Example1.java, findbugs has no issues.
In Example2.java, findbugs doesn't like the access of file.listFiles() in the range based for loop, despite it being null checked outside the loop.

Discussion

  • L.W.

    L.W. - 2017-01-02

    If the first call of listFiles() is != null, that doesn't mean the second call is also != null.
    That is no false positive.

     
  • Andrey Loskutov

    Andrey Loskutov - 2017-10-22
    • Status: open --> closed-rejected
     

Log in to post a comment.