You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Dustin Pho (JIRA)" <ji...@apache.org> on 2016/10/02 20:39:20 UTC

[jira] [Commented] (LANG-947) WordUtils delimiters should be strings, not char varargs

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

Dustin Pho commented on LANG-947:
---------------------------------

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)