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:46:00 GMT


ASF GitHub Bot commented on LANG-1406:

Github user kinow commented on the issue:
    I'm surprised by this bug. Had no idea something like this could happen. Will debug later
and see if I can understand why that happens (might have to train my brain to default to always
use uppercase instead of lowercase?). Thanks for the pull request, we will review the code
and if everything looks OK a committer will merge it.

> 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