[ 
https://issues.apache.org/jira/browse/LANG-947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15540949#comment-15540949
 ] 

Dustin Pho edited comment on LANG-947 at 10/2/16 8:40 PM:
----------------------------------------------------------

I don't think an additional (overloaded) method will work. The compiler will 
complain about ambiguity  because null can be passed to both functions.

{code:title=Example|borderStyle=solid}
public static String capitalize(String str, String delimiters) {
    return capitalize(str, delimiters.toCharArray());
}

public static String capitalize(String str, char... delimiters) { ... }
{code}


was (Author: pho):
I don't think an additional (overloaded) method will work. The compiler will 
complain about ambiguity  because null can be passed to both functions.

Example:
  public static String capitalize(String str, String delimiters) {
    return capitalize(str, delimiters.toCharArray());
  }
  public static String capitalize(String str, char... delimiters) { ... }

> WordUtils delimiters should be strings, not char varargs
> --------------------------------------------------------
>
>                 Key: LANG-947
>                 URL: https://issues.apache.org/jira/browse/LANG-947
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.text.*
>            Reporter: Andrew Pennebaker
>            Priority: Minor
>              Labels: api,, interface,ease,of,use,, robustness,
>             Fix For: Patch Needed
>
>
> Strings behave like char varargs of arbitrary length, but are much easier to 
> use.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to