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

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

commit 1b338d09b783116782d986adc12dabe88f597457
Author: remm <[email protected]>
AuthorDate: Fri Oct 24 12:58:35 2025 +0200

    Java compat
---
 java/org/apache/jasper/servlet/JspServletWrapper.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/jasper/servlet/JspServletWrapper.java 
b/java/org/apache/jasper/servlet/JspServletWrapper.java
index 7094ba7cff..c9bcd59ba3 100644
--- a/java/org/apache/jasper/servlet/JspServletWrapper.java
+++ b/java/org/apache/jasper/servlet/JspServletWrapper.java
@@ -528,9 +528,11 @@ public class JspServletWrapper {
         try {
             Throwable realException = ex;
             // Unwrap Servlet exception once
-            if (ex instanceof ServletException servletException
-                    && servletException.getRootCause() != null) {
-                realException = servletException.getRootCause();
+            if (ex instanceof ServletException) {
+                Throwable rootCause = ((ServletException) ex).getRootCause();
+                if (rootCause != null) {
+                    realException = rootCause;
+                }
             }
 
             // Find the first stack frame that represents code generated by


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to