garydgregory commented on a change in pull request #784:
URL: https://github.com/apache/commons-lang/pull/784#discussion_r683017191



##########
File path: src/main/java/org/apache/commons/lang3/StringUtils.java
##########
@@ -4858,6 +5127,38 @@ public static String join(final short[] array, final 
char delimiter, final int s
         return join(elements, null);
     }
 
+    public static String join(byte[] elements, String separator) {
+        return (elements == null) ? null : join(elements, separator, 0, 
elements.length);
+    }
+
+    public static String join(boolean[] elements, String separator) {
+        return (elements == null) ? null : join(elements, separator, 0, 
elements.length);
+    }
+
+    public static String join(char[] elements, String separator) {
+        return (elements == null) ? null : join(elements, separator, 0, 
elements.length);
+    }
+
+    public static String join(double[] elements, String separator) {
+        return (elements == null) ? null : join(elements, separator, 0, 
elements.length);
+    }
+
+    public static String join(float[] elements, String separator) {
+        return (elements == null) ? null : join(elements, separator, 0, 
elements.length);
+    }
+
+    public static String join(int[] elements, String separator) {
+        return (elements == null) ? null : join(elements, separator, 0, 
elements.length);
+    }
+
+    public static String join(long[] elements, String separator) {
+        return (elements == null) ? null : join(elements, separator, 0, 
elements.length);
+    }
+
+    public static String join(short[] elements, String separator) {
+        return (elements == null) ? null : join(elements, separator, 0, 
elements.length);
+    }

Review comment:
       Remove useless parentheses please.

##########
File path: src/main/java/org/apache/commons/lang3/StringUtils.java
##########
@@ -4858,6 +5127,38 @@ public static String join(final short[] array, final 
char delimiter, final int s
         return join(elements, null);
     }
 
+    public static String join(byte[] elements, String separator) {

Review comment:
       All public methods should be Javadoc'd.

##########
File path: src/main/java/org/apache/commons/lang3/StringUtils.java
##########
@@ -4818,13 +5052,48 @@ public static String join(final short[] array, final 
char delimiter) {
      * @since 3.2
      */
     public static String join(final short[] array, final char delimiter, final 
int startIndex, final int endIndex) {
+        return join(array, String.valueOf(delimiter), startIndex, endIndex);
+    }
+
+    /**
+     * <p>

Review comment:
       The 1st para of a Javadoc is automatically in a paragraph IIRC.

##########
File path: src/main/java/org/apache/commons/lang3/StringUtils.java
##########
@@ -4307,13 +4481,48 @@ public static String join(final int[] array, final char 
separator) {
      * @since 3.2
      */
     public static String join(final int[] array, final char delimiter, final 
int startIndex, final int endIndex) {
+        return join(array, String.valueOf(delimiter), startIndex, endIndex);
+    }
+
+    /**
+     * <p>
+     * Joins the elements of the provided array into a single String 
containing the provided list of elements.
+     * </p>
+     *
+     * <p>
+     * No delimiter is added before or after the list. Null objects or empty 
strings within the array are represented
+     * by empty strings.
+     * </p>
+     *
+     * <pre>
+     * StringUtils.join(null, *)               = null
+     * StringUtils.join([], *)                 = ""
+     * StringUtils.join([null], *)             = ""
+     * StringUtils.join([1, 2, 3], ';')  = "1;2;3"
+     * StringUtils.join([1, 2, 3], null) = "123"
+     * </pre>
+     *
+     * @param array
+     *            the array of values to join together, may be null
+     * @param delimiter
+     *            the separator String to use
+     * @param startIndex
+     *            the first index to start joining from. It is an error to 
pass in a start index past the end of the
+     *            array
+     * @param endIndex
+     *            the index to stop joining from (exclusive). It is an error 
to pass in an end index past the end of
+     *            the array
+     * @return the joined String, {@code null} if null array input
+     * @since 3.13.0
+     */
+    public static String join(final int[] array, final String delimiter, final 
int startIndex, final int endIndex) {
         if (array == null) {
             return null;
         }
         if (endIndex - startIndex <= 0) {
             return EMPTY;
         }
-        final StringJoiner joiner = newStringJoiner(delimiter);
+        final StringJoiner joiner = new 
StringJoiner(toStringOrEmpty(delimiter));

Review comment:
       Why did you remove the private helper method?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to