This is an automated email from the ASF dual-hosted git repository.
lihan 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 1f654363f1 Fix BZ 66331
1f654363f1 is described below
commit 1f654363f1f1ebde4f1fb805b2b978f72bc3bbee
Author: lihan <[email protected]>
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 bbbd2e97c9..b778b75c52 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -114,6 +114,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: [email protected]
For additional commands, e-mail: [email protected]