commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LANG-410) Ambiguous / confusing names in StringUtils replace* methods
Date Wed, 06 Feb 2008 19:13:08 GMT

     [ https://issues.apache.org/jira/browse/LANG-410?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sebb updated LANG-410:
----------------------

    Attachment: StringUtils.patch

> Ambiguous / confusing names in StringUtils replace* methods
> -----------------------------------------------------------
>
>                 Key: LANG-410
>                 URL: https://issues.apache.org/jira/browse/LANG-410
>             Project: Commons Lang
>          Issue Type: Bug
>            Reporter: Sebb
>            Priority: Minor
>         Attachments: StringUtils.patch
>
>
> The recently added replaceEach* methods use "repl" for the original string list, and
"with" for the new (replacement) string list.
> These names are rather confusing.
> RE engines tend to use words such as:
> Perl:
> searchlist
> replacementlist
> ORO:
> pattern
> replacement
> Java has String.replace(regex, replacement)
> In all cases, "replacement" is used for the NEW string, not the original string which
is to be replaced.
> Seems to me that searchString/List and replacement[List] would be unambiguous as well
as descriptive.
> Also useful in IDEs which show possible method completions.
> Changing the names of the parameters would not affect the API.
> Patch to follow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message