You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2022/09/15 15:36:37 UTC
[tomcat] 02/02: Refactor to avoid use of Hashtable. No functional change.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 2d7179a80c2f761e6ceb9d915afa4b956a22f1ee
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Sep 15 16:34:52 2022 +0100
Refactor to avoid use of Hashtable. No functional change.
---
java/org/apache/coyote/ajp/Constants.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/java/org/apache/coyote/ajp/Constants.java b/java/org/apache/coyote/ajp/Constants.java
index 17e57a7fd8..1da971b589 100644
--- a/java/org/apache/coyote/ajp/Constants.java
+++ b/java/org/apache/coyote/ajp/Constants.java
@@ -16,7 +16,8 @@
*/
package org.apache.coyote.ajp;
-import java.util.Hashtable;
+import java.util.HashMap;
+import java.util.Map;
/**
* Constants.
@@ -211,13 +212,13 @@ public final class Constants {
return responseTransArray[code];
}
- private static final Hashtable<String,Integer> responseTransHash = new Hashtable<>(20);
+ private static final Map<String,Integer> responseTransMap = new HashMap<>(20);
static {
try {
int i;
for (i = 0; i < SC_RESP_AJP13_MAX; i++) {
- responseTransHash.put(getResponseHeaderForCode(i), Integer.valueOf(0xA001 + i));
+ responseTransMap.put(getResponseHeaderForCode(i), Integer.valueOf(0xA001 + i));
}
}
catch (Exception e) {
@@ -226,7 +227,7 @@ public final class Constants {
}
public static final int getResponseAjpIndex(String header) {
- Integer i = responseTransHash.get(header);
+ Integer i = responseTransMap.get(header);
if (i == null) {
return 0;
} else {
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org