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

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

commit 6800e8348025c323ff70b5438ef2796e8003a48d
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 a0bf15353f..9e54acbf77 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -1811,8 +1811,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 b0c83469ed..68224e5c50 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -2069,8 +2069,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