commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dustin Pho (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-947) WordUtils delimiters should be strings, not char varargs
Date Sun, 02 Oct 2016 20:39:20 GMT

    [ 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)

Mime
View raw message