This is an automated email from the ASF dual-hosted git repository.
rmaucher 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 c7fcd0d5c7 TagPluginManager init needs to be thread safe
c7fcd0d5c7 is described below
commit c7fcd0d5c77179a29f0737a1c035b74cd743b0d8
Author: remm <[email protected]>
AuthorDate: Mon Jun 1 09:38:14 2026 +0200
TagPluginManager init needs to be thread safe
---
java/org/apache/jasper/compiler/TagPluginManager.java | 8 +++++---
webapps/docs/changelog.xml | 3 +++
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/java/org/apache/jasper/compiler/TagPluginManager.java
b/java/org/apache/jasper/compiler/TagPluginManager.java
index ca75f4850a..ab88b458b7 100644
--- a/java/org/apache/jasper/compiler/TagPluginManager.java
+++ b/java/org/apache/jasper/compiler/TagPluginManager.java
@@ -40,7 +40,7 @@ public class TagPluginManager {
private static final String TAG_PLUGINS_XML = "/WEB-INF/tagPlugins.xml";
private final ServletContext ctxt;
private HashMap<String,TagPlugin> tagPlugins;
- private boolean initialized = false;
+ private volatile boolean initialized = false;
/**
* Creates a new TagPluginManager for the given servlet context.
@@ -61,13 +61,15 @@ public class TagPluginManager {
*/
public void apply(Node.Nodes page, ErrorDispatcher err, PageInfo pageInfo)
throws JasperException {
- init(err);
+ if (!initialized) {
+ init(err);
+ }
if (!tagPlugins.isEmpty()) {
page.visit(new NodeVisitor(this, pageInfo));
}
}
- private void init(ErrorDispatcher err) throws JasperException {
+ private synchronized void init(ErrorDispatcher err) throws JasperException
{
if (initialized) {
return;
}
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4e331ed9bc..749edf0299 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -287,6 +287,9 @@
<fix>
Fix possible EL argument mismatch when it was set to null. (remm)
</fix>
+ <fix>
+ Fix thread safety of <code>TagPluginManager</code>. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Cluster">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]