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

StringUtils abbreviate returns String of length greater than maxWidth

    XMLWordPrintableJSON

    Details

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

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

              Dates

              • Created:
                Updated:
                Resolved: