commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Ryan (JIRA)" <j...@apache.org>
Subject [jira] [Created] (LANG-1406) StringIndexOutOfBoundsException in StringUtils.replaceIgnoreCase
Date Wed, 01 Aug 2018 12:22:00 GMT
Michael Ryan created LANG-1406:
----------------------------------

             Summary: StringIndexOutOfBoundsException in StringUtils.replaceIgnoreCase
                 Key: LANG-1406
                 URL: https://issues.apache.org/jira/browse/LANG-1406
             Project: Commons Lang
          Issue Type: Bug
          Components: lang.*
            Reporter: Michael Ryan


STEPS TO REPRODUCE:
{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
(v7.6.3#76005)

Mime
View raw message