From: markt Date: Sun, 28 Jan 2007 15:28:23 +0000 (+0000) Subject: Simplify code since ServletException now uses standard exception chaining. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=26c0c9904f6eea44f631dd7d8a4ac7f2d03196a5;p=tomcat7.0 Simplify code since ServletException now uses standard exception chaining. git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@500812 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/core/StandardWrapper.java b/java/org/apache/catalina/core/StandardWrapper.java index 9dc8d4b6f..c090a6237 100644 --- a/java/org/apache/catalina/core/StandardWrapper.java +++ b/java/org/apache/catalina/core/StandardWrapper.java @@ -709,9 +709,7 @@ public class StandardWrapper return theException; } - if (theRootCause instanceof ServletException) { - deeperRootCause = ((ServletException) theRootCause).getRootCause(); - } else if (jspExceptionClazz!=null && + if (jspExceptionClazz!=null && jspExceptionClazz.isAssignableFrom(theRootCause.getClass())) { deeperRootCause = (Throwable)IntrospectionUtils.getProperty( theRootCause, "rootCause"); diff --git a/java/org/apache/catalina/valves/ErrorReportValve.java b/java/org/apache/catalina/valves/ErrorReportValve.java index 1a2d62200..479cba368 100644 --- a/java/org/apache/catalina/valves/ErrorReportValve.java +++ b/java/org/apache/catalina/valves/ErrorReportValve.java @@ -241,10 +241,7 @@ public class ErrorReportValve sb.append("

"); // In case root cause is somehow heavily nested try { - if (rootCause instanceof ServletException) { - nestedRootCause = - ((ServletException) rootCause).getRootCause(); - } else if (jspExceptionClazz!=null && + if (jspExceptionClazz!=null && jspExceptionClazz.isAssignableFrom( rootCause.getClass())) { nestedRootCause = (Throwable)IntrospectionUtils.