< prev index next >
test/hotspot/jtreg/runtime/appcds/jvmti/InstrumentationTest.java
Print this page
@@ -180,13 +180,13 @@
}
// 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);
+ try (FileOutputStream o = new FileOutputStream(f)) {
o.write(1);
- o.close();
+ }
if (!f.exists()) {
throw new RuntimeException("Failed to create " + f);
}
// At this point, the child process is not yet launched. Note that
< prev index next >