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

commit 1fedce1b153e03d4b209b1db59005ddef655e89f
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Sep 14 19:22:43 2022 +0100

    Refactor to avoid use of Hashtable. No functional change.
---
 java/org/apache/catalina/ha/session/DeltaSession.java | 3 +--
 java/org/apache/catalina/session/StandardSession.java | 5 ++---
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/catalina/ha/session/DeltaSession.java 
b/java/org/apache/catalina/ha/session/DeltaSession.java
index 2b72a3ab36..f2640a7f8f 100644
--- a/java/org/apache/catalina/ha/session/DeltaSession.java
+++ b/java/org/apache/catalina/ha/session/DeltaSession.java
@@ -27,7 +27,6 @@ import java.io.Serializable;
 import java.io.WriteAbortedException;
 import java.security.Principal;
 import java.util.ArrayList;
-import java.util.Hashtable;
 import java.util.List;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -959,7 +958,7 @@ public class DeltaSession extends StandardSession 
implements Externalizable,Clus
         }
 
         if (notes == null) {
-            notes = new Hashtable<>();
+            notes = new ConcurrentHashMap<>();
         }
         activate();
     }
diff --git a/java/org/apache/catalina/session/StandardSession.java 
b/java/org/apache/catalina/session/StandardSession.java
index 4afd6662e1..ae906c67fc 100644
--- a/java/org/apache/catalina/session/StandardSession.java
+++ b/java/org/apache/catalina/session/StandardSession.java
@@ -31,7 +31,6 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashSet;
-import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -227,7 +226,7 @@ public class StandardSession implements HttpSession, 
Session, Serializable {
      * and event listeners.  <b>IMPLEMENTATION NOTE:</b> This object is
      * <em>not</em> saved and restored across session serializations!
      */
-    protected transient Map<String, Object> notes = new Hashtable<>();
+    protected transient Map<String, Object> notes = new ConcurrentHashMap<>();
 
 
     /**
@@ -1576,7 +1575,7 @@ public class StandardSession implements HttpSession, 
Session, Serializable {
         }
 
         if (notes == null) {
-            notes = new Hashtable<>();
+            notes = new ConcurrentHashMap<>();
         }
         /*
          * The next object read could either be the number of attributes


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

Reply via email to