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

lihan 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 a26ccf25a1 Iterate over Map.entrySet() instead of Map.keySet()
a26ccf25a1 is described below

commit a26ccf25a17a1eea0e2a5ee7b6e0663c8e9bfd30
Author: lihan <li...@apache.org>
AuthorDate: Fri Sep 16 14:31:54 2022 +0800

    Iterate over Map.entrySet() instead of Map.keySet()
---
 java/org/apache/catalina/servlets/WebdavServlet.java | 5 +++--
 java/org/apache/jasper/compiler/Generator.java       | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java 
b/java/org/apache/catalina/servlets/WebdavServlet.java
index 7b9e7f84fd..405a281b48 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -1812,8 +1812,9 @@ public class WebdavServlet extends DefaultServlet {
 
         generatedXML.writeElement("D", DEFAULT_NAMESPACE, "multistatus", 
XMLWriter.OPENING);
 
-        for (String errorPath : errorList.keySet()) {
-            int errorCode = errorList.get(errorPath).intValue();
+        for (Map.Entry<String, Integer> errorEntry : errorList.entrySet()) {
+            String errorPath = errorEntry.getKey();
+            int errorCode = errorEntry.getValue().intValue();
 
             generatedXML.writeElement("D", "response", XMLWriter.OPENING);
 
diff --git a/java/org/apache/jasper/compiler/Generator.java 
b/java/org/apache/jasper/compiler/Generator.java
index 34c6e41abf..41c8feb67a 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -1837,8 +1837,8 @@ class Generator {
             out.print(" + " + elemName);
 
             // Write remaining attributes
-            for (String attrName : map.keySet()) {
-                out.print(map.get(attrName));
+            for (Entry<String, String> attrEntry : map.entrySet()) {
+                out.print(attrEntry.getValue());
             }
 
             // Does the <jsp:element> have nested tags other than


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

Reply via email to