geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashishj...@apache.org
Subject svn commit: r1035171 - /geronimo/server/branches/2.1/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/GeronimoTldLocationsCache.java
Date Mon, 15 Nov 2010 08:04:37 GMT
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
                     }
                 }
             }
+          }
         }
     }
 



Mime
View raw message