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

commit 1cd626daedc5358e573e604214c65e896cd5d1be
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