This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new bba1d1f0a0 Fix regression in the fix for BZ 69333
bba1d1f0a0 is described below
commit bba1d1f0a0fcfcceb195552fb51f6380621126f5
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 | 5 +++++
2 files changed, 16 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 8aa824209b..ac2a4372e2 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -333,6 +333,11 @@
<code>java.util.Date</code>. (markt)
</add>
<!-- Entries for backport and removal before 12.0.0-M1 below this line
-->
+ <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">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]