UF.OUTUF (Use Freed) issues are reported when there is an attempt to use resources after they were released. The UF.OUT warning indicates an attempt to use an output stream after it was closed. Example 115 public boolean writeMeta(OutputStream stream) { 16 try { 17 stream.write("mystate".getBytes()); 18 } catch (IOException e) { 19 return false; 20 } finally { 21 try { 22 stream.close(); 23 } catch (IOException e) { 24 // do nothing 25 } 26 } 27 return true; 28 } 29 30 public void saveState(final String path, final byte[] data) throws IOException { 31 final FileOutputStream stream = new FileOutputStream(path); 32 if (writeMeta(stream)) { 33 stream.write(data); 34 } 35 } UF.OUT is reported for the snippet on line 33: the output stream 'stream' is used after it was closed on line 22. |