From 1dd3a636aa80035cd9460024ece488b036ad1085 Mon Sep 17 00:00:00 2001 From: Matthew Jason Benson Date: Mon, 4 Apr 2011 14:55:08 +0000 Subject: [PATCH] varargs git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1088656 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/commons/lang3/StringUtils.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java index 156f1ed4c..f3dbd48a7 100644 --- a/src/main/java/org/apache/commons/lang3/StringUtils.java +++ b/src/main/java/org/apache/commons/lang3/StringUtils.java @@ -580,7 +580,7 @@ public static String stripEnd(String str, String stripChars) { * @param strs the array to remove whitespace from, may be null * @return the stripped Strings, {@code null} if null array input */ - public static String[] stripAll(String[] strs) { + public static String[] stripAll(String... strs) { return stripAll(strs, null); } @@ -1461,9 +1461,9 @@ public static boolean containsWhitespace(String str) { * @param searchChars the chars to search for, may be null * @return the index of any of the chars, -1 if no match or null input * @since 2.0 - * @since 3.0 Changed signature from indexOfAny(String, char[]) to indexOfAny(CharSequence, char[]) + * @since 3.0 Changed signature from indexOfAny(String, char[]) to indexOfAny(CharSequence, char...) */ - public static int indexOfAny(CharSequence cs, char[] searchChars) { + public static int indexOfAny(CharSequence cs, char... searchChars) { if (isEmpty(cs) || ArrayUtils.isEmpty(searchChars)) { return INDEX_NOT_FOUND; } @@ -1544,7 +1544,7 @@ public static int indexOfAny(CharSequence cs, String searchChars) { * {@code false} if no match or null input * @since 2.4 */ - public static boolean containsAny(String cs, char[] searchChars) { + public static boolean containsAny(String cs, char... searchChars) { if (isEmpty(cs) || ArrayUtils.isEmpty(searchChars)) { return false; } @@ -1632,9 +1632,9 @@ public static boolean containsAny(String cs, String searchChars) { * @param searchChars the chars to search for, may be null * @return the index of any of the chars, -1 if no match or null input * @since 2.0 - * @since 3.0 Changed signature from indexOfAnyBut(String, char[]) to indexOfAnyBut(CharSequence, char[]) + * @since 3.0 Changed signature from indexOfAnyBut(String, char[]) to indexOfAnyBut(CharSequence, char...) */ - public static int indexOfAnyBut(CharSequence cs, char[] searchChars) { + public static int indexOfAnyBut(CharSequence cs, char... searchChars) { if (isEmpty(cs) || ArrayUtils.isEmpty(searchChars)) { return INDEX_NOT_FOUND; } @@ -1727,9 +1727,9 @@ public static int indexOfAnyBut(String str, String searchChars) { * @param cs the String to check, may be null * @param valid an array of valid chars, may be null * @return true if it only contains valid chars and is non-null - * @since 3.0 Changed signature from containsOnly(String, char[]) to containsOnly(CharSequence, char[]) + * @since 3.0 Changed signature from containsOnly(String, char[]) to containsOnly(CharSequence, char...) */ - public static boolean containsOnly(CharSequence cs, char[] valid) { + public static boolean containsOnly(CharSequence cs, char... valid) { // All these pre-checks are to maintain API with an older version if (valid == null || cs == null) { return false; @@ -1796,9 +1796,9 @@ public static boolean containsOnly(CharSequence cs, String validChars) { * @param searchChars an array of invalid chars, may be null * @return true if it contains none of the invalid chars, or is null * @since 2.0 - * @since 3.0 Changed signature from containsNone(String, char[]) to containsNone(CharSequence, char[]) + * @since 3.0 Changed signature from containsNone(String, char[]) to containsNone(CharSequence, char...) */ - public static boolean containsNone(CharSequence cs, char[] searchChars) { + public static boolean containsNone(CharSequence cs, char... searchChars) { if (cs == null || searchChars == null) { return true; } @@ -1886,7 +1886,7 @@ public static boolean containsNone(CharSequence cs, String invalidChars) { * @param searchStrs the Strings to search for, may be null * @return the first index of any of the searchStrs in str, -1 if no match */ - public static int indexOfAny(String str, String[] searchStrs) { + public static int indexOfAny(String str, String... searchStrs) { if (str == null || searchStrs == null) { return INDEX_NOT_FOUND; } @@ -1939,7 +1939,7 @@ public static int indexOfAny(String str, String[] searchStrs) { * @param searchStrs the Strings to search for, may be null * @return the last index of any of the Strings, -1 if no match */ - public static int lastIndexOfAny(String str, String[] searchStrs) { + public static int lastIndexOfAny(String str, String... searchStrs) { if (str == null || searchStrs == null) { return INDEX_NOT_FOUND; }