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 2fd20f8  Revert "Remove deprecated and unused code"
2fd20f8 is described below

commit 2fd20f852ed8ffde09578c60cbcff1c986ff5398
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Jun 15 20:56:26 2021 +0100

    Revert "Remove deprecated and unused code"
    
    This reverts commit 2a3ebd0478b2422acb3580d6c865a30cdf3a05bf.
---
 java/org/apache/catalina/valves/RemoteIpValve.java | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/java/org/apache/catalina/valves/RemoteIpValve.java 
b/java/org/apache/catalina/valves/RemoteIpValve.java
index e2cd6d3..fcae228 100644
--- a/java/org/apache/catalina/valves/RemoteIpValve.java
+++ b/java/org/apache/catalina/valves/RemoteIpValve.java
@@ -21,7 +21,9 @@ import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.Deque;
 import java.util.Enumeration;
+import java.util.Iterator;
 import java.util.LinkedList;
+import java.util.List;
 import java.util.regex.Pattern;
 
 import jakarta.servlet.ServletException;
@@ -375,6 +377,32 @@ public class RemoteIpValve extends ValveBase {
             .split(commaDelimitedStrings);
     }
 
+    /**
+     * Convert an array of strings in a comma delimited string
+     * @param stringList The string list to convert
+     * @return The concatenated string
+     *
+     * @deprecated Unused. This will be removed in Tomcat 10.1.x onwards.
+     *             Use {@link StringUtils#join(java.util.Collection)} instead
+     */
+    @Deprecated
+    protected static String listToCommaDelimitedString(List<String> 
stringList) {
+        if (stringList == null) {
+            return "";
+        }
+        StringBuilder result = new StringBuilder();
+        for (Iterator<String> it = stringList.iterator(); it.hasNext();) {
+            Object element = it.next();
+            if (element != null) {
+                result.append(element);
+                if (it.hasNext()) {
+                    result.append(", ");
+                }
+            }
+        }
+        return result.toString();
+    }
+
     private String hostHeader = null;
 
     private boolean changeLocalName = false;

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

Reply via email to