This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 709d13c693 Refactor to avoid use of Hashtable where possible. No 
functional change.
709d13c693 is described below

commit 709d13c6932e07bc907f4f888fa5d5f20e7ead19
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Sep 15 17:25:35 2022 +0100

    Refactor to avoid use of Hashtable where possible. No functional change.
---
 java/org/apache/tomcat/util/IntrospectionUtils.java           | 4 +++-
 test/org/apache/catalina/tribes/demos/IntrospectionUtils.java | 5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/tomcat/util/IntrospectionUtils.java 
b/java/org/apache/tomcat/util/IntrospectionUtils.java
index a10a42ca96..4345e4a988 100644
--- a/java/org/apache/tomcat/util/IntrospectionUtils.java
+++ b/java/org/apache/tomcat/util/IntrospectionUtils.java
@@ -21,6 +21,8 @@ import java.lang.reflect.Method;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.Hashtable;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
@@ -359,7 +361,7 @@ public final class IntrospectionUtils {
         objectMethods.clear();
     }
 
-    private static final Hashtable<Class<?>,Method[]> objectMethods = new 
Hashtable<>();
+    private static final Map<Class<?>,Method[]> objectMethods = new 
ConcurrentHashMap<>();
 
     public static Method[] findMethods(Class<?> c) {
         Method methods[] = objectMethods.get(c);
diff --git a/test/org/apache/catalina/tribes/demos/IntrospectionUtils.java 
b/test/org/apache/catalina/tribes/demos/IntrospectionUtils.java
index 816a1ae5c9..885d56701c 100644
--- a/test/org/apache/catalina/tribes/demos/IntrospectionUtils.java
+++ b/test/org/apache/catalina/tribes/demos/IntrospectionUtils.java
@@ -20,7 +20,8 @@ import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
-import java.util.Hashtable;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
@@ -209,7 +210,7 @@ public final class IntrospectionUtils {
         objectMethods.clear();
     }
 
-    static Hashtable<Class<?>,Method[]> objectMethods = new Hashtable<>();
+    static Map<Class<?>,Method[]> objectMethods = new ConcurrentHashMap<>();
 
     public static Method[] findMethods(Class<?> c) {
         Method methods[] = objectMethods.get(c);


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

Reply via email to