You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by li...@apache.org on 2022/11/02 02:13:39 UTC

[tomcat] branch 10.1.x updated: Fix BZ 66331

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

lihan pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
     new 130d03c720 Fix BZ 66331
130d03c720 is described below

commit 130d03c7201807de440c9b2c60e1a9240b920ae9
Author: lihan <li...@apache.org>
AuthorDate: Wed Nov 2 10:09:18 2022 +0800

    Fix BZ 66331
    
    Fix a regression in refactoring for Stack on the SystemLogHandler which caught incorrect exception.
---
 java/org/apache/tomcat/util/log/SystemLogHandler.java | 4 ++--
 webapps/docs/changelog.xml                            | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/log/SystemLogHandler.java b/java/org/apache/tomcat/util/log/SystemLogHandler.java
index 2293f349af..946d9d6d9b 100644
--- a/java/org/apache/tomcat/util/log/SystemLogHandler.java
+++ b/java/org/apache/tomcat/util/log/SystemLogHandler.java
@@ -20,7 +20,7 @@ import java.io.IOException;
 import java.io.PrintStream;
 import java.util.ArrayDeque;
 import java.util.Deque;
-import java.util.EmptyStackException;
+import java.util.NoSuchElementException;
 import java.util.Queue;
 import java.util.concurrent.ConcurrentLinkedQueue;
 
@@ -83,7 +83,7 @@ public class SystemLogHandler extends PrintStream {
         if (!reuse.isEmpty()) {
             try {
                 log = reuse.remove();
-            } catch (EmptyStackException e) {
+            } catch (NoSuchElementException e) {
                 log = new CaptureLog();
             }
         } else {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 08fbbc26c3..9c6e2a1ff1 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -123,6 +123,11 @@
         <code>Context</code> was ignored and the default was always used.
         (markt)
       </fix>
+      <fix>
+        <bug>66331</bug>: Fix a regression in refactoring for <code>Stack</code>
+        on the <code>SystemLogHandler</code> which caught incorrect exception.
+        (lihan)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">


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