Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1406

StringIndexOutOfBoundsException in StringUtils.replaceIgnoreCase()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.10
    • lang.*
    • None

    Description

      STEPS TO REPRODUCE:

      StringUtils.replaceIgnoreCase("\u0130x", "x", "")
      

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              michaelryan Michael Ryan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 4h
                  4h