--- old/test/hotspot/jtreg/runtime/appcds/jvmti/InstrumentationTest.java 2017-12-12 16:26:12.370465281 -0800 +++ new/test/hotspot/jtreg/runtime/appcds/jvmti/InstrumentationTest.java 2017-12-12 16:26:11.530433787 -0800 @@ -182,9 +182,9 @@ // We use the flagFile to prevent the child process to make progress, until we have // attached to it. File f = new File(flagFile); - FileOutputStream o = new FileOutputStream(f); - o.write(1); - o.close(); + try (FileOutputStream o = new FileOutputStream(f)) { + o.write(1); + } if (!f.exists()) { throw new RuntimeException("Failed to create " + f); }