src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java

Print this page
rev 3516 : 7021582: convert jar/zip code and tests to use try-with-resources
Reviewed-by: XXX

*** 159,170 **** if (out == null) { throw new NullPointerException("null output"); } // Use the stream-based implementation. // %%% Reconsider if native unpacker learns to memory-map the file. ! FileInputStream instr = new FileInputStream(in); unpack(instr, out); if (props.getBoolean(Utils.UNPACK_REMOVE_PACKFILE)) { in.delete(); } } --- 159,171 ---- if (out == null) { throw new NullPointerException("null output"); } // Use the stream-based implementation. // %%% Reconsider if native unpacker learns to memory-map the file. ! try (FileInputStream instr = new FileInputStream(in)) { unpack(instr, out); + } if (props.getBoolean(Utils.UNPACK_REMOVE_PACKFILE)) { in.delete(); } }