< prev index next >

test/hotspot/jtreg/runtime/appcds/MultiReleaseJars.java

Print this page

*** 70,86 **** static void writeFile(File file, String... contents) throws Exception { if (contents == null) { throw new java.lang.RuntimeException("No input for writing to file" + file); } FileOutputStream fos = new FileOutputStream(file); ! PrintStream ps = new PrintStream(fos); for (String str : contents) { ps.println(str); } ! ps.close(); ! fos.close(); } /* version.jar entries and files: * META-INF/ * META-INF/MANIFEST.MF --- 70,87 ---- static void writeFile(File file, String... contents) throws Exception { if (contents == null) { throw new java.lang.RuntimeException("No input for writing to file" + file); } + try ( FileOutputStream fos = new FileOutputStream(file); ! PrintStream ps = new PrintStream(fos) ! ) { for (String str : contents) { ps.println(str); } ! } } /* version.jar entries and files: * META-INF/ * META-INF/MANIFEST.MF
< prev index next >