You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2022/09/15 15:46:07 UTC

[tomcat] branch 10.0.x updated: The Javadoc for getInitParameters() states the returned Map is immutable

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.0.x by this push:
     new 4aaed624f0 The Javadoc for getInitParameters() states the returned Map is immutable
4aaed624f0 is described below

commit 4aaed624f02161cbad017f1f0d3f1e65393b1a4a
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Sep 15 16:45:44 2022 +0100

    The Javadoc for getInitParameters() states the returned Map is immutable
---
 java/jakarta/servlet/jsp/tagext/TagLibraryValidator.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/java/jakarta/servlet/jsp/tagext/TagLibraryValidator.java b/java/jakarta/servlet/jsp/tagext/TagLibraryValidator.java
index e45361405f..58d27581c7 100644
--- a/java/jakarta/servlet/jsp/tagext/TagLibraryValidator.java
+++ b/java/jakarta/servlet/jsp/tagext/TagLibraryValidator.java
@@ -16,6 +16,8 @@
 */
 package jakarta.servlet.jsp.tagext;
 
+import java.util.Collections;
+import java.util.HashMap;
 import java.util.Map;
 
 /**
@@ -96,7 +98,7 @@ public abstract class TagLibraryValidator {
      * @param map A Map describing the init parameters
      */
     public void setInitParameters(Map<String, Object> map) {
-        initParameters = map;
+        initParameters = Collections.unmodifiableMap(new HashMap<>(map));
     }
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org