From: markt Date: Fri, 23 Jul 2010 10:35:20 +0000 (+0000) Subject: Revert part of previous clean-up. Jar needs to remain open X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=078413c6f842546552158fb591e6d53b91c01661;p=tomcat7.0 Revert part of previous clean-up. Jar needs to remain open git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@967026 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/naming/resources/BaseDirContext.java b/java/org/apache/naming/resources/BaseDirContext.java index 1cd892352..fc7d97552 100644 --- a/java/org/apache/naming/resources/BaseDirContext.java +++ b/java/org/apache/naming/resources/BaseDirContext.java @@ -154,10 +154,9 @@ public abstract class BaseDirContext implements DirContext { * a requested resource can not be found in the main context. */ public void addResourcesJar(URL url) { - JarFile jarFile = null; try { JarURLConnection conn = (JarURLConnection) url.openConnection(); - jarFile = conn.getJarFile(); + JarFile jarFile = conn.getJarFile(); ZipEntry entry = jarFile.getEntry("/"); WARDirContext warDirContext = new WARDirContext(jarFile, new WARDirContext.Entry("/", entry)); @@ -165,14 +164,6 @@ public abstract class BaseDirContext implements DirContext { altDirContexts.add(warDirContext); } catch (IOException ioe) { log.warn(sm.getString("resources.addResourcesJarFail", url), ioe); - } finally { - if (jarFile != null) { - try { - jarFile.close(); - } catch (IOException e) { - // Ignore - } - } } }