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 Wed, 10 Dec 2003 23:45:40 GMT
remm        2003/12/10 15:45:40

  Modified:    catalina/src/share/org/apache/catalina/loader
                        WebappClassLoader.java
  Log:
  - Cache the result of getURLs. Everything else is cached, but this wasn't.
  
  Revision  Changes    Path
  1.28      +15 -2     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.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- WebappClassLoader.java	29 Nov 2003 09:08:16 -0000	1.27
  +++ WebappClassLoader.java	10 Dec 2003 23:45:39 -0000	1.28
  @@ -297,6 +297,12 @@
       protected String[] repositories = new String[0];
   
   
  +     /**
  +      * Repositories URLs, used to cache the result of getURLs.
  +      */
  +     protected URL[] repositoryURLs = null;
  +
  +
       /**
        * Repositories translated as path in the work directory (for Jasper
        * originally), but which is used to generate fake URLs should getURLs be
  @@ -1405,6 +1411,10 @@
        */
       public URL[] getURLs() {
   
  +        if (repositoryURLs != null) {
  +            return repositoryURLs;
  +        }
  +
           URL[] external = super.getURLs();
   
           int filesLength = files.length;
  @@ -1425,9 +1435,11 @@
                   }
               }
   
  -            return urls;
  +            repositoryURLs = urls;
  +            return repositoryURLs;
   
           } catch (MalformedURLException e) {
  +            repositoryURLs = new URL[0];
               return (new URL[0]);
           }
   
  @@ -1506,6 +1518,7 @@
           resourceEntries.clear();
           resources = null;
           repositories = null;
  +        repositoryURLs = null;
           files = null;
           jarFiles = null;
           jarRealFiles = null;
  
  
  

---------------------------------------------------------------------
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