--- old/test/java/util/zip/ZipFile/ReadAfterClose.java 2011-02-23 19:50:15.552161769 -0800 +++ new/test/java/util/zip/ZipFile/ReadAfterClose.java 2011-02-23 19:50:15.247731661 -0800 @@ -34,10 +34,13 @@ public class ReadAfterClose { public static void main(String[] argv) throws Exception { - ZipFile zf = new ZipFile(new File(System.getProperty("test.src","."),"crash.jar")); - ZipEntry zent = zf.getEntry("Test.java"); - InputStream in = zf.getInputStream(zent); - zf.close(); + InputStream in; + try (ZipFile zf = new ZipFile( + new File(System.getProperty("test.src","."),"crash.jar"))) { + ZipEntry zent = zf.getEntry("Test.java"); + in = zf.getInputStream(zent); + } + // ensure zf is closed at this point try { in.read(); } catch (IOException e) {