This is an automated email from the ASF dual-hosted git repository.
rmaucher 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 badf6487a5 TagPluginManager init needs to be thread safe
badf6487a5 is described below
commit badf6487a5b886f308a7787b0f767e81c6c88859
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 82eaa4c077..6c3b375a46 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 4edf8beae9..f30f548fbb 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -279,6 +279,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]