tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r936892 - /tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
Date Thu, 22 Apr 2010 15:14:13 GMT
Author: rjung
Date: Thu Apr 22 15:14:11 2010
New Revision: 936892

URL: http://svn.apache.org/viewvc?rev=936892&view=rev
Log:
Respect configurable search order in getURLs().

Modified:
    tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java

Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java?rev=936892&r1=936891&r2=936892&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java (original)
+++ tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Thu Apr 22 15:14:11
2010
@@ -1679,19 +1679,30 @@ public class WebappClassLoader
 
         int filesLength = files.length;
         int jarFilesLength = jarRealFiles.length;
-        int length = filesLength + jarFilesLength + external.length;
+        int externalsLength = external.length;
+        int off = 0;
         int i;
 
         try {
 
-            URL[] urls = new URL[length];
-            for (i = 0; i < length; i++) {
-                if (i < filesLength) {
-                    urls[i] = getURL(files[i], true);
-                } else if (i < filesLength + jarFilesLength) {
-                    urls[i] = getURL(jarRealFiles[i - filesLength], true);
-                } else {
-                    urls[i] = external[i - filesLength - jarFilesLength];
+            URL[] urls = new URL[filesLength + jarFilesLength + externalsLength];
+            if (searchExternalFirst) {
+                for (i = 0; i < externalsLength; i++) {
+                    urls[i] = external[i];
+                }
+                off = externalsLength;
+            }
+            for (i = 0; i < filesLength; i++) {
+                urls[off + i] = getURL(files[i], true);
+            }
+            off += filesLength;
+            for (i = 0; i < jarFilesLength; i++) {
+                urls[off + i] = getURL(jarRealFiles[i], true);
+            }
+            off += jarFilesLength;
+            if (!searchExternalFirst) {
+                for (i = 0; i < externalsLength; i++) {
+                    urls[off + i] = external[i];
                 }
             }
 



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


Mime
View raw message