velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r680772 - /velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/IntrospectorCacheImpl.java
Date Tue, 29 Jul 2008 17:04:15 GMT
Author: nbubna
Date: Tue Jul 29 10:04:15 2008
New Revision: 680772

URL: http://svn.apache.org/viewvc?rev=680772&view=rev
Log:
prevent ConcurrentModificationExceptions with cache listeners

Modified:
    velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/IntrospectorCacheImpl.java

Modified: velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/IntrospectorCacheImpl.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/IntrospectorCacheImpl.java?rev=680772&r1=680771&r2=680772&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/IntrospectorCacheImpl.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/IntrospectorCacheImpl.java
Tue Jul 29 10:04:15 2008
@@ -62,7 +62,7 @@
      */
     public IntrospectorCacheImpl(final Log log)
     {
-	this.log = log;
+	    this.log = log;
     }
 
     /**
@@ -145,7 +145,7 @@
      *
      * @param listener A Cache listener object.
      */
-    public void addListener(final IntrospectorCacheListener listener)
+    public synchronized void addListener(final IntrospectorCacheListener listener)
     {
         listeners.add(listener);
     }
@@ -155,7 +155,7 @@
      *
      * @param listener A Cache listener object.
      */
-    public void removeListener(final IntrospectorCacheListener listener)
+    public synchronized void removeListener(final IntrospectorCacheListener listener)
     {
         listeners.remove(listener);
     }



Mime
View raw message