[
https://issues.apache.org/jira/browse/LANG-396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848504#action_12848504
]
Henri Yandell commented on LANG-396:
------------------------------------
Remaining possibilities seem to just be in StringUtils now:
---
While it might make sense for the first, it would be confusing for the second.
Skip.
public static String[] stripAll(String[] strs);
public static String[] stripAll(String[] strs, String stripChars);
---
Generally all the same type, the char[]/String[] could be vararged, but isn't a
great fit.
public static int indexOfAny(CharSequence cs, char[] searchChars);
public static boolean containsAny(String cs, char[] searchChars);
public static int indexOfAnyBut(CharSequence cs, char[] searchChars);
public static boolean containsOnly(CharSequence cs, char[] valid);
public static boolean containsNone(CharSequence cs, char[] searchChars);
public static int indexOfAny(String str, String[] searchStrs);
public static int lastIndexOfAny(String str, String[] searchStrs);
public static boolean startsWithAny(String string, String[] searchStrings);
---
The join method itself would be great to have vararg'd, but the other options
will get in its way. Reversing the parameters won't help with the desire for a
join(Object... elements) API.
public static String join(Object[] array);
public static String join(Object[] array, char separator);
public static String join(Object[] array, char separator, int startIndex,
int endIndex);
public static String join(Object[] array, String separator);
public static String join(Object[] array, String separator, int startIndex,
int endIndex);
A new method should solve that. We removed the deprecated concatenate method;
with String.concat now existing I think we can bring in a
StringUtils.concat(Object... elements) method. Also tempting to add a
StringUtils.concatWith(String separator, Object... elements) method.
> Investigate for vararg usages
> -----------------------------
>
> Key: LANG-396
> URL: https://issues.apache.org/jira/browse/LANG-396
> Project: Commons Lang
> Issue Type: Task
> Components: General
> Reporter: Henri Yandell
> Fix For: 3.0
>
> Attachments: VarargsCandidates.java
>
>
> Which methods are good candidates for varargs.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.