8160025: compiler/testlibrary/uncommontrap/Verifier doesn't close FileReader
Reviewed-by: kvn
--- a/hotspot/test/compiler/testlibrary/uncommontrap/Verifier.java Wed Jun 22 13:29:09 2016 +0300
+++ b/hotspot/test/compiler/testlibrary/uncommontrap/Verifier.java Wed Jun 22 21:24:07 2016 +0300
@@ -34,6 +34,7 @@
import java.util.regex.Pattern;
import jdk.test.lib.Asserts;
+
/**
* Utility tool aimed to verify presence or absence of specified uncommon trap
* in compilation log.
@@ -78,7 +79,9 @@
PROPERTIES_FILE_SUFFIX);
Properties properties = new Properties();
- properties.load(new FileReader(propertiesFile.toFile()));
+ try (FileReader reader = new FileReader(propertiesFile.toFile())) {
+ properties.load(reader);
+ }
if (Boolean.valueOf(properties.getProperty(
VERIFICATION_SHOULD_BE_SKIPPED, "false"))) {