Sonar violation: “Method may fail to close stream on exception”

前端 未结 4 1404
青春惊慌失措
青春惊慌失措 2021-01-28 00:15

I have this method:

 private void unZipElementsTo(String inputZipFileName, String destPath) throws FileNotFoundException, IOException {

        OutputStream out         


        
4条回答
  •  迷失自我
    2021-01-28 00:36

    If out.close() or zf.close() in the finally block throw an exception then the other closes won't be executed.

提交回复
热议问题