This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new 4a1e04e49d Fix regression in the fix for BZ 69333
4a1e04e49d is described below
commit 4a1e04e49d3bed0c3ef35cd1f46ad5144af53bcb
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Jan 13 20:34:00 2026 +0000
Fix regression in the fix for BZ 69333
Tag reuse() / release() must always be in a finally block.
---
java/org/apache/jasper/compiler/Generator.java | 14 +++++++++++---
webapps/docs/changelog.xml | 9 +++++++++
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/java/org/apache/jasper/compiler/Generator.java
b/java/org/apache/jasper/compiler/Generator.java
index d6de95d869..95bf0e95e2 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -2091,6 +2091,10 @@ class Generator {
writeNewInstance(tagHandlerVar, tagHandlerClass);
}
+ // Wrap use of tag in try/finally to ensure clean-up takes place
+ out.printil("try {");
+ out.pushIndent();
+
// includes setting the context
generateSetters(n, tagHandlerVar, handlerInfo, false);
@@ -2270,13 +2274,15 @@ class Generator {
out.pushIndent();
out.printin(tagHandlerVar);
out.println(".doFinally();");
- }
-
- if (n.implementsTryCatchFinally()) {
out.popIndent();
out.printil("}");
}
+ // Ensure clean-up takes place
+ out.popIndent();
+ out.printil("} finally {");
+ out.pushIndent();
+
if (usePooling(n)) {
// Print tag reuse
out.printin(n.getTagHandlerPoolName());
@@ -2289,6 +2295,8 @@ class Generator {
out.print(tagHandlerVar);
out.println(", _jsp_getInstanceManager());");
}
+ out.popIndent();
+ out.printil("}");
// Declare and synchronize AT_END scripting variables (must do this
// outside the try/catch/finally block)
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 85f4b4d6d9..c3ab657109 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -189,6 +189,15 @@
</add>
</changelog>
</subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
+ <bug>69333</bug>: Correct a regression in the previous fix for
+ <bug>69333</bug> and ensure that <code>reuse()</code> or
+ <code>release()</code> is always called for a tag. (markt)
+ </fix>
+ </changelog>
+ </subsection>
<subsection name="Cluster">
<changelog>
<add>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]