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

StringUtils.center() methods have inaccurate examples in javadocs

    XMLWordPrintableJSON

Details

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

    Description

      The javadoc comments for two of the center() methods in StringUtils.java have incorrect examples of the method's behavior.

      In both instances the method is shown to behave thusly:

      StringUtils.center("ab", 4, ' ') = " ab"

      when in fact it produces the result " ab " (note the extra space at the end).

      The methods affected:

      1. public static String center(String str, int size, char padChar)
      2. public static String center(String str, int size, String padStr)

      Attachments

        Activity

          People

            Unassigned Unassigned
            jlindwall John Lindwall
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: