changeset 43099:47f8baf1fcbd

8172767: a bulk of tests failed with FileSystemException on Windows Reviewed-by: chegar
author sherman
date Fri, 13 Jan 2017 01:07:50 -0800
parents 124d24e7988c
children a7e3457672c7
files jdk/src/jdk.jartool/share/classes/sun/tools/jar/Main.java jdk/src/jdk.jartool/share/classes/sun/tools/jar/Validator.java
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Main.java	Thu Jan 12 22:44:13 2017 -0800
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Main.java	Fri Jan 13 01:07:50 2017 -0800
@@ -434,8 +434,8 @@
 
     private void validateAndClose(File tmpfile) throws IOException {
         if (ok && isMultiRelease) {
-            try {
-                ok = Validator.validate(this, tmpfile);
+            try (JarFile jf = new JarFile(tmpfile)) {
+                ok = Validator.validate(this, jf);
                 if (!ok) {
                     error(formatMsg("error.validator.jarfile.invalid", fname));
                 }
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Validator.java	Thu Jan 12 22:44:13 2017 -0800
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Validator.java	Fri Jan 13 01:07:50 2017 -0800
@@ -74,8 +74,8 @@
         loadModuleDescriptor();
     }
 
-    static boolean validate(Main main, File f) throws IOException {
-        return new Validator(main, new JarFile(f)).validate();
+    static boolean validate(Main main, JarFile jf) throws IOException {
+        return new Validator(main, jf).validate();
     }
 
     private boolean validate() {