This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 8fa36be782 Review "Avoid NullPointerException in include error path
for non-JAR..."
8fa36be782 is described below
commit 8fa36be7822eab11bc8edb11d7f0a831829ba218
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Nov 5 17:55:22 2026 +0000
Review "Avoid NullPointerException in include error path for non-JAR..."
Include root cause to aid debugging
---
java/org/apache/jasper/compiler/Parser.java | 3 ++-
java/org/apache/jasper/compiler/ParserController.java | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/java/org/apache/jasper/compiler/Parser.java
b/java/org/apache/jasper/compiler/Parser.java
index fcaf136364..368aeaeaf8 100644
--- a/java/org/apache/jasper/compiler/Parser.java
+++ b/java/org/apache/jasper/compiler/Parser.java
@@ -331,7 +331,8 @@ class Parser implements TagConstants {
} catch (FileNotFoundException ex) {
err.jspError(start, "jsp.error.file.not.found", file);
} catch (Exception e) {
- err.jspError(start, e.getMessage());
+ // Retain the exception as the cause so the original failure is
not lost
+ err.jspError(start, e, e.getMessage());
}
}
diff --git a/java/org/apache/jasper/compiler/ParserController.java
b/java/org/apache/jasper/compiler/ParserController.java
index e9852b73ff..3e34e3d815 100644
--- a/java/org/apache/jasper/compiler/ParserController.java
+++ b/java/org/apache/jasper/compiler/ParserController.java
@@ -199,7 +199,7 @@ public class ParserController implements TagConstants {
absFileName = resolveFileName(inFileName);
} catch (URISyntaxException e) {
// Note: jar may be null here, so avoid referencing it
- err.jspError("jsp.error.invalid.include", inFileName);
+ err.jspError(e, "jsp.error.invalid.include", inFileName);
}
if (processingTagInJar &&
!absFileName.startsWith(TAGS_IN_JAR_LOCATION)) {
/*
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]