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

StringIndexOutOfBoundsException in StringUtils.replaceIgnoreCase()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.10
    • Component/s: lang.*
    • Labels:
      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

              • Assignee:
                Unassigned
                Reporter:
                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