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
Post a Comment