commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (LANG-1406) StringIndexOutOfBoundsException in StringUtils.replaceIgnoreCase
Date Wed, 08 Aug 2018 12:14:00 GMT


ASF GitHub Bot commented on LANG-1406:

GitHub user HiuKwok opened a pull request:

    [LANG-1406]  StringIndexOutOfBoundsException in StringUtils.replaceIgnoreCase

    Fix for Lang-1406 to avoid any exception while performing String.UTils.replaceIgnoreCase()
against uniCode String object. 
    Plz let me if there have any extra things need to be done for this PR since I am the first
timer for commons-lang project( add more test case?).
    All the best

You can merge this pull request into a Git repository by running:

    $ git pull master

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #340
commit e0f6c7802b5e721019a602bf30b31c79dbf6d233
Author: Hiu Kwok <hiufkwok@...>
Date:   2018-08-08T11:44:51Z

    toUpperCase() > toLowerCase() to avoid unicode string length miscalculation

commit 590f90889bf61a5570bd98b78e73410a07d7410b
Author: Hiu Kwok <hiufkwok@...>
Date:   2018-08-08T11:46:29Z

    Assertion for example mentioned on LANG-1406 Description


> StringIndexOutOfBoundsException in StringUtils.replaceIgnoreCase
> ----------------------------------------------------------------
>                 Key: LANG-1406
>                 URL:
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>            Reporter: Michael Ryan
>            Priority: Major
> {code}
> StringUtils.replaceIgnoreCase("\u0130x", "x", "")
> {code}
> EXPECTED: "\u0130" is returned.
> ACTUAL: StringIndexOutOfBoundsException
> This happens because the replace method is assuming that text.length() == text.toLowerCase().length(),
which is not true for certain characters.

This message was sent by Atlassian JIRA

View raw message