commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pascal Schumacher (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (LANG-742) [IgnoreCase] methods for ArrayUtils
Date Wed, 19 Apr 2017 15:47:41 GMT

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

Pascal Schumacher closed LANG-742.
----------------------------------
       Resolution: Won't Fix
    Fix Version/s:     (was: Review Patch)

No comments for over 5 years. I guess this feature is a bit too specific for commons-lang,
so I'm closing this.

> [IgnoreCase] methods for ArrayUtils
> -----------------------------------
>
>                 Key: LANG-742
>                 URL: https://issues.apache.org/jira/browse/LANG-742
>             Project: Commons Lang
>          Issue Type: New Feature
>          Components: lang.*
>            Reporter: Michael Lyons
>            Priority: Minor
>         Attachments: StringArrayUtils.java, StringArrayUtilsTest.java
>
>
> This is a proposal for a feature addition.
> On several projects, I've needed to perform case insensitive manipulation on Arrays of
Strings. My original need was just a solution for containsIgnoreCase(String[], String) and
indexOfIgnoreCase(String[], String). In an effort to keep things simple, I created this class
which implements 8 [IgnoreCase] methods that could be a benefit to Commons Lang users.
> StringArrayUtils extends ArrayUtils, it provides case insensitive manipulation on an
Array of Strings.
> The new methods provided in the class are:
> containsIgnoreCase(String[] array, String stringToFind)
> indexOfIgnoreCase(String[] array, String stringToFind)
> indexOfIgnoreCase(String[] array, String stringToFind, int startIndex)
> isEqualsIgnoreCase(String[] array1, String[] array2)
> lastIndexOfIgnoreCase(String[] array, String stringToFind)
> lastIndexOfIgnoreCase(String[] array, String stringToFind, int startIndex)
> removeElementIgnoreCase(String[] array, String element)
> removeElementsIgnoreCase(String[] array, String... values)
> These eight methods cover the functional pattern provided in ArrayUtils. Any comparison
in ArrayUtils based on obj1.equals(obj2) now has an equivalent str1.equalsIgnoreCase(str2)
in StringArrayUtils.
> I've included a test case and have made efforts to match your coding convention and style.
Thanks in advance for your time and consideration. I'd be happy to follow up with any changes
or edits if you think this is something that might be included in a future version of Commons
Lang.
> ...Mike
> Ps. I understand that handling a special case for the String's equalsIgnoreCase(...)
may  be a slippery slope - which has been intentionally avoided.  I have also considered overloading
the above eight methods with a Comparator parameter, but requiring a user to pass in a not-null,
case-insensitive comparator didn't seem as straight forward as the above solution.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message