This is an automated email from the ASF dual-hosted git repository.
rmaucher pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new f4841fa565 TagPluginManager init needs to be thread safe
f4841fa565 is described below
commit f4841fa5651c41894181ea6f57ca1a51b61c4961
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 33fa5bd772..2cf16df8a9 100644
--- a/java/org/apache/jasper/compiler/TagPluginManager.java
+++ b/java/org/apache/jasper/compiler/TagPluginManager.java
@@ -43,7 +43,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.
@@ -64,13 +64,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 5c931e6789..dffa409320 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -283,6 +283,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]