velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r778054 - in /velocity/engine/branches/2.0_Exp/src/java/org/apache/velocity/util/introspection: ClassMap.java MethodMap.java
Date Sat, 23 May 2009 22:49:55 GMT
Author: nbubna
Date: Sat May 23 22:49:55 2009
New Revision: 778054

URL: http://svn.apache.org/viewvc?rev=778054&view=rev
Log:
VELOCITY-718 prevent infinite loop in HashMap.get()

Modified:
    velocity/engine/branches/2.0_Exp/src/java/org/apache/velocity/util/introspection/ClassMap.java
    velocity/engine/branches/2.0_Exp/src/java/org/apache/velocity/util/introspection/MethodMap.java

Modified: velocity/engine/branches/2.0_Exp/src/java/org/apache/velocity/util/introspection/ClassMap.java
URL: http://svn.apache.org/viewvc/velocity/engine/branches/2.0_Exp/src/java/org/apache/velocity/util/introspection/ClassMap.java?rev=778054&r1=778053&r2=778054&view=diff
==============================================================================
--- velocity/engine/branches/2.0_Exp/src/java/org/apache/velocity/util/introspection/ClassMap.java
(original)
+++ velocity/engine/branches/2.0_Exp/src/java/org/apache/velocity/util/introspection/ClassMap.java
Sat May 23 22:49:55 2009
@@ -23,6 +23,7 @@
 import java.lang.reflect.Modifier;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 import org.apache.commons.lang.text.StrBuilder;
 import org.apache.velocity.runtime.log.Log;
 
@@ -215,7 +216,7 @@
          * Cache of Methods, or CACHE_MISS, keyed by method
          * name and actual arguments used to find it.
          */
-        private final Map cache = new HashMap();
+        private final Map cache = new ConcurrentHashMap();
 
         /** Map of methods that are searchable according to method parameters to find a match
*/
         private final MethodMap methodMap = new MethodMap();

Modified: velocity/engine/branches/2.0_Exp/src/java/org/apache/velocity/util/introspection/MethodMap.java
URL: http://svn.apache.org/viewvc/velocity/engine/branches/2.0_Exp/src/java/org/apache/velocity/util/introspection/MethodMap.java?rev=778054&r1=778053&r2=778054&view=diff
==============================================================================
--- velocity/engine/branches/2.0_Exp/src/java/org/apache/velocity/util/introspection/MethodMap.java
(original)
+++ velocity/engine/branches/2.0_Exp/src/java/org/apache/velocity/util/introspection/MethodMap.java
Sat May 23 22:49:55 2009
@@ -21,11 +21,11 @@
 
 import java.lang.reflect.Method;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 /**
  *
@@ -45,7 +45,7 @@
     /**
      * Keep track of all methods with the same name.
      */
-    Map methodByNameMap = new HashMap();
+    Map methodByNameMap = new ConcurrentHashMap();
 
     /**
      * Add a method to a list of methods by name.



Mime
View raw message