This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push: new d94dcbb0d2 Refactor to avoid use of Hashtable where possible. No functional change. d94dcbb0d2 is described below commit d94dcbb0d2aa6ea4a217c7e8bc1fcc7f676bab64 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 36dbcdffd2..0818d90fee 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; @@ -402,7 +404,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