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:37:00 UTC

[tomcat] branch 9.0.x updated (1361ae0da6 -> 49f5c7fa8e)

This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


    from 1361ae0da6 Refactor to avoid use of Hashtable. No functional change.
     new 84db379278 Formatting
     new 49f5c7fa8e Refactor to avoid use of Hashtable. No functional change.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/coyote/ajp/Constants.java | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)


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


[tomcat] 02/02: Refactor to avoid use of Hashtable. No functional change.

Posted by ma...@apache.org.
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

commit 49f5c7fa8e7e12e9ab3b2429073b3a7fe74fc6d0
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


[tomcat] 01/02: Formatting

Posted by ma...@apache.org.
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

commit 84db3792786602afa35dfdaf4ab402660dc2077c
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Sep 15 16:32:51 2022 +0100

    Formatting
---
 java/org/apache/coyote/ajp/Constants.java | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/coyote/ajp/Constants.java b/java/org/apache/coyote/ajp/Constants.java
index 355c7659dc..17e57a7fd8 100644
--- a/java/org/apache/coyote/ajp/Constants.java
+++ b/java/org/apache/coyote/ajp/Constants.java
@@ -81,8 +81,6 @@ public final class Constants {
     // Terminates list of attributes
     public static final byte SC_A_ARE_DONE      = (byte)0xFF;
 
-    // Ajp13 specific -  needs refactoring for the new model
-
     /**
      * Default maximum total byte size for an AJP packet
      */
@@ -213,15 +211,13 @@ public final class Constants {
         return responseTransArray[code];
     }
 
-    private static final Hashtable<String,Integer>  responseTransHash =
-            new Hashtable<>(20);
+    private static final Hashtable<String,Integer>  responseTransHash = new Hashtable<>(20);
 
     static {
         try {
             int i;
             for (i = 0; i < SC_RESP_AJP13_MAX; i++) {
-                responseTransHash.put(getResponseHeaderForCode(i),
-                        Integer.valueOf(0xA001 + i));
+                responseTransHash.put(getResponseHeaderForCode(i), Integer.valueOf(0xA001 + i));
             }
         }
         catch (Exception e) {
@@ -229,8 +225,7 @@ public final class Constants {
         }
     }
 
-    public static final int getResponseAjpIndex(String header)
-    {
+    public static final int getResponseAjpIndex(String header) {
         Integer i = responseTransHash.get(header);
         if (i == null) {
             return 0;


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