This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new 9741030e38 Refactor to avoid use of Hashtable. No functional change.
9741030e38 is described below
commit 9741030e386d6734854a411a1987266549804e8e
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Sep 15 15:40:00 2022 +0100
Refactor to avoid use of Hashtable. No functional change.
---
java/jakarta/servlet/jsp/tagext/TagSupport.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/java/jakarta/servlet/jsp/tagext/TagSupport.java
b/java/jakarta/servlet/jsp/tagext/TagSupport.java
index b604bf0594..8cc2fca9e2 100644
--- a/java/jakarta/servlet/jsp/tagext/TagSupport.java
+++ b/java/jakarta/servlet/jsp/tagext/TagSupport.java
@@ -17,8 +17,10 @@
package jakarta.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 jakarta.servlet.jsp.JspException;
import jakarta.servlet.jsp.PageContext;
@@ -227,7 +229,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);
}
@@ -266,7 +268,7 @@ public class TagSupport implements IterationTag,
Serializable {
if (values == null) {
return null;
}
- return values.keys();
+ return Collections.enumeration(values.keySet());
}
/**
@@ -277,7 +279,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: [email protected]
For additional commands, e-mail: [email protected]