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 f877a9dc96 Refactor to avoid use of Hashtable. No functional change. f877a9dc96 is described below commit f877a9dc96d3020a245f917b57adfa5fedcaf210 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 3bf4c069bb..27ea4a7120 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<>(); /** @@ -1571,7 +1570,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