From a47044b6ca4f271a61872f2b0c1e33b7d56633bc Mon Sep 17 00:00:00 2001 From: chegar Date: Fri, 14 Jun 2013 16:38:13 +0100 Subject: [PATCH] 8012156: tools/javac/file/zip/T6865530.java fails for win32/64 in 7u25 nightly runs Reviewed-by: alanb --- src/share/classes/sun/misc/URLClassPath.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/share/classes/sun/misc/URLClassPath.java b/src/share/classes/sun/misc/URLClassPath.java index 6c5e2c1b9..993d96ecb 100644 --- a/src/share/classes/sun/misc/URLClassPath.java +++ b/src/share/classes/sun/misc/URLClassPath.java @@ -722,8 +722,16 @@ public class URLClassPath { /* Throws if the given jar file is does not start with the correct LOC */ static JarFile checkJar(JarFile jar) throws IOException { if (System.getSecurityManager() != null && !DISABLE_JAR_CHECKING - && !zipAccess.startsWithLocHeader(jar)) - throw new IOException("Invalid Jar file"); + && !zipAccess.startsWithLocHeader(jar)) { + IOException x = new IOException("Invalid Jar file"); + try { + jar.close(); + } catch (IOException ex) { + x.addSuppressed(ex); + } + throw x; + } + return jar; } -- GitLab