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

WordUtils.abbreviate bug when lower is greater than str.length

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4
    • 2.5
    • lang.*
    • None

    Description

      In WordUtils.abbreviate, upper is adjusted to the length of the string, then to lower.
      But lower is never adjusted to the length of the string, so if lower is greater than str.lengt(), upper will be too...
      Then, str.substring(0, upper) throw a StringIndexOutOfBoundsException

      The fix is to adjust lower to the length of the string

      Attachments

        Activity

          People

            Unassigned Unassigned
            v.behar Vincent Behar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: