tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/loader WebappClassLoader.java
Date Fri, 30 Jul 2004 09:43:32 GMT
remm        2004/07/30 02:43:32

  Modified:    catalina/src/share/org/apache/catalina/loader
                        WebappClassLoader.java
  Log:
  - Move the try/catch IOE inside the loop, as suggested in bug 30362.
  
  Revision  Changes    Path
  1.41      +14 -14    jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java
  
  Index: WebappClassLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- WebappClassLoader.java	26 Jul 2004 15:52:17 -0000	1.40
  +++ WebappClassLoader.java	30 Jul 2004 09:43:32 -0000	1.41
  @@ -1512,21 +1512,21 @@
        */
       public void closeJARs(boolean force) {
           if (jarFiles.length > 0) {
  -            try {
                   synchronized (jarFiles) {
                       if (force || (System.currentTimeMillis() 
                                     > (lastJarAccessed + 90000))) {
                           for (int i = 0; i < jarFiles.length; i++) {
  -                            if (jarFiles[i] != null) {
  -                                jarFiles[i].close();
  -                                jarFiles[i] = null;
  +                            try {
  +                            	if (jarFiles[i] != null) {
  +                            		jarFiles[i].close();
  +                            		jarFiles[i] = null;
  +                            	}
  +                            } catch (IOException e) {
  +                                log.warn("Failed to close JAR", e);
                               }
                           }
                       }
                   }
  -            } catch (IOException e) {
  -                log.warn("Failed to close JAR", e);
  -            }
           }
       }
   
  @@ -1541,12 +1541,12 @@
           if (started && (jarFiles.length > 0)) {
               lastJarAccessed = System.currentTimeMillis();
               if (jarFiles[0] == null) {
  -                try {
  -                    for (int i = 0; i < jarFiles.length; i++) {
  -                        jarFiles[i] = new JarFile(jarRealFiles[i]);
  -                    }
  -                } catch (IOException e) {
  -                    log.warn("Failed to open JAR", e);
  +                for (int i = 0; i < jarFiles.length; i++) {
  +                	try {
  +                		jarFiles[i] = new JarFile(jarRealFiles[i]);
  +                	} catch (IOException e) {
  +                		log.warn("Failed to open JAR", e);
  +                	}
                   }
               }
           }
  
  
  

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


Mime
View raw message