You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by as...@apache.org on 2010/11/15 09:04:37 UTC

svn commit: r1035171 - /geronimo/server/branches/2.1/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/GeronimoTldLocationsCache.java

Author: ashishjain
Date: Mon Nov 15 08:04:37 2010
New Revision: 1035171

URL: http://svn.apache.org/viewvc?rev=1035171&view=rev
Log:
GERONIMO-5683 Avoid concurrent access to the scannedJars Arraylist

Modified:
    geronimo/server/branches/2.1/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/GeronimoTldLocationsCache.java

Modified: geronimo/server/branches/2.1/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/GeronimoTldLocationsCache.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/GeronimoTldLocationsCache.java?rev=1035171&r1=1035170&r2=1035171&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/GeronimoTldLocationsCache.java (original)
+++ geronimo/server/branches/2.1/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/GeronimoTldLocationsCache.java Mon Nov 15 08:04:37 2010
@@ -462,6 +462,8 @@ public class GeronimoTldLocationsCache e
             URL[] urls = ((URLClassLoader) loader).getURLs();
             for (int i=0; i<urls.length; i++) {
                 URLConnection conn = urls[i].openConnection();
+             // Avoid concurrent access to the scannedJars ArrayList and also potential duplication
+                synchronized (this) {
                 if (conn instanceof JarURLConnection) {
                     if (needScanJar(loader,
                                     ((JarURLConnection) conn).getJarFile().getName())) {
@@ -480,6 +482,7 @@ public class GeronimoTldLocationsCache e
                     }
                 }
             }
+          }
         }
     }