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

StringUtils abbreviate returns String of length greater than maxWidth

    XMLWordPrintableJSON

Details

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

    Description

      In the JavaDoc of StringUtils.abbreviate(final String str, final String abbrevMarker, final int maxWidth) is written, that the method in no case will return a String of length greater than maxWidth. This doesn't hold, if abbrevMarker is an empty string.

      Expected behaviour:

      abbreviate("much too long text", "", 13).equals("much too long")

       

      Actual behaviour:

      abbreviate("much too long text", "", 13).equals("much too long text")

      Attachments

        Activity

          People

            Unassigned Unassigned
            twessendorf Thomas Wessendorf
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: