Menu

#1230 Try-with-resources returns false positive on OS_OPEN_STREAM

3.0.0
closed-fixed
JDK 1.7 (1)
5
2014-01-08
2013-12-05
No

Findbugs returns a false positive for OS_OPEN_STREAM with the following code in JAVA 1.7:

try (ObjectOutput output = new ObjectOutputStream(new FileOutputStream(fileToWrite))) {
output.writeObject(serializable);
}

This is the new try with resources and the output stream is automatically closed. This should not be returned as positive.

Discussion

  • William Pugh

    William Pugh - 2013-12-17
    • status: open --> open-accepted
    • assigned_to: William Pugh
     
  • William Pugh

    William Pugh - 2013-12-17
    • Group: 2.0.3 --> 3.0.0
     
  • William Pugh

    William Pugh - 2014-01-08
    • status: open-accepted --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB