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 02f82e801e Refactor to avoid use of Hashtable. No functional change.
02f82e801e is described below

commit 02f82e801e02b642c85d5eaefa0246e66b8a5a29
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Sep 15 15:40:00 2022 +0100

    Refactor to avoid use of Hashtable. No functional change.
---
 java/javax/servlet/jsp/tagext/TagSupport.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/java/javax/servlet/jsp/tagext/TagSupport.java 
b/java/javax/servlet/jsp/tagext/TagSupport.java
index b70cf8207d..cd13d42bf7 100644
--- a/java/javax/servlet/jsp/tagext/TagSupport.java
+++ b/java/javax/servlet/jsp/tagext/TagSupport.java
@@ -17,8 +17,10 @@
 package javax.servlet.jsp.tagext;
 
 import java.io.Serializable;
+import java.util.Collections;
 import java.util.Enumeration;
-import java.util.Hashtable;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.PageContext;
@@ -230,7 +232,7 @@ public class TagSupport implements IterationTag, 
Serializable {
      */
     public void setValue(String k, Object o) {
         if (values == null) {
-            values = new Hashtable<>();
+            values = new ConcurrentHashMap<>();
         }
         values.put(k, o);
     }
@@ -269,7 +271,7 @@ public class TagSupport implements IterationTag, 
Serializable {
         if (values == null) {
             return null;
         }
-        return values.keys();
+        return Collections.enumeration(values.keySet());
     }
 
     /**
@@ -280,7 +282,7 @@ public class TagSupport implements IterationTag, 
Serializable {
     /**
      * Map of object values keyed by Strings for this tag.
      */
-    private Hashtable<String, Object> values;
+    private Map<String, Object> values;
 
     /**
      * The value of the id attribute of this tag; or null.


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

Reply via email to