java - Fortify marks try-with-resources as Medium severity Issue -


i have generated fortify code review , got medium severity closing filestream(in try-with-resources block) , file.delete in finally. how remove these issues?

category    detail  location    severity poor error handling : throw inside  finallyblock classa.java:108    medium poor error handling : throw inside  finallyblock    classb.java:87  medium 

classa.java: 108

try (outputstream recordsfileout = new fileoutputstream(downloadfile.tofile());      outputstream rejectedfileout = new fileoutputstream(rejectedrecordsfile.tofile())) {         ......   } 

classb.java: 87

try {  } catch(ioexception ex) {   } {     outputfile.tofile().delete(); } 

from code showing can deduce outputfile.tofile() must throw catchable exception. cause .delete() bypassed , must fortify complaing about.

see this page more details.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -