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/10/05 17:02:11 UTC
[tomcat] branch 8.5.x updated: Additional comment to explain choice of LinkedList
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 2d0ce12c2e Additional comment to explain choice of LinkedList
2d0ce12c2e is described below
commit 2d0ce12c2e578b12cc36cd94576025c4b8b7800d
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Oct 5 18:01:49 2022 +0100
Additional comment to explain choice of LinkedList
---
java/org/apache/catalina/session/ManagerBase.java | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/java/org/apache/catalina/session/ManagerBase.java b/java/org/apache/catalina/session/ManagerBase.java
index 97b1825b85..8893aed26f 100644
--- a/java/org/apache/catalina/session/ManagerBase.java
+++ b/java/org/apache/catalina/session/ManagerBase.java
@@ -119,11 +119,9 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
protected static final int TIMING_STATS_CACHE_SIZE = 100;
- protected final Deque<SessionTiming> sessionCreationTiming =
- new LinkedList<>();
-
- protected final Deque<SessionTiming> sessionExpirationTiming =
- new LinkedList<>();
+ // Use LinkedList as the Deques are initialised by filling with null
+ protected final Deque<SessionTiming> sessionCreationTiming = new LinkedList<>();
+ protected final Deque<SessionTiming> sessionExpirationTiming = new LinkedList<>();
/**
* Number of sessions that have expired.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org