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/06 11:22:01 UTC

[tomcat] branch 10.0.x updated: Can't switch to ArrayDeque here. Needs to be LinkedList for null support

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


The following commit(s) were added to refs/heads/10.0.x by this push:
     new a1002464a2 Can't switch to ArrayDeque here. Needs to be LinkedList for null support
a1002464a2 is described below

commit a1002464a2df9db8b0ae4d2989205bc2ef544d6b
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Oct 6 12:21:43 2022 +0100

    Can't switch to ArrayDeque here. Needs to be LinkedList for null support
---
 java/org/apache/jasper/compiler/PageInfo.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/jasper/compiler/PageInfo.java b/java/org/apache/jasper/compiler/PageInfo.java
index 68c3566c06..1bf47aac2e 100644
--- a/java/org/apache/jasper/compiler/PageInfo.java
+++ b/java/org/apache/jasper/compiler/PageInfo.java
@@ -16,12 +16,12 @@
  */
 package org.apache.jasper.compiler;
 
-import java.util.ArrayDeque;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Deque;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -336,7 +336,8 @@ class PageInfo {
     public void pushPrefixMapping(String prefix, String uri) {
         Deque<String> stack = xmlPrefixMapper.get(prefix);
         if (stack == null) {
-            stack = new ArrayDeque<>();
+            // Must be LinkedList as it needs to accept nulls
+            stack = new LinkedList<>();
             xmlPrefixMapper.put(prefix, stack);
         }
         stack.addFirst(uri);


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