tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r967026 - /tomcat/trunk/java/org/apache/naming/resources/BaseDirContext.java
Date Fri, 23 Jul 2010 10:35:21 GMT
Author: markt
Date: Fri Jul 23 10:35:20 2010
New Revision: 967026

URL: http://svn.apache.org/viewvc?rev=967026&view=rev
Log:
Revert part of previous clean-up. Jar needs to remain open

Modified:
    tomcat/trunk/java/org/apache/naming/resources/BaseDirContext.java

Modified: tomcat/trunk/java/org/apache/naming/resources/BaseDirContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/BaseDirContext.java?rev=967026&r1=967025&r2=967026&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/BaseDirContext.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/BaseDirContext.java Fri Jul 23 10:35:20
2010
@@ -154,10 +154,9 @@ public abstract class BaseDirContext imp
      * 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 imp
             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
-                }
-            }
         }
     }
     



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message