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

StringUtils#capitalize: Javadoc says toTitleCase; code uses toUpperCase

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.4
    • 3.5
    • lang.*
    • None

    Description

      The capitalize Javadoc says the code uses Character#toTitleCase, however the code actually uses Character#toUpperCase.

      Generally these produce the same result, but some charsets may have different characters for upper and title case - see for example the Javadoc [1] for Character#isTitleCase.

      The way I read this, the character that looks like "lj" is lower-case, "LJ" is upper case and "Lj" is title case - i.e. not the same.

      The question here is: should the code be corrected to use TitleCase or should the Javadoc be corrected to use UpperCase?

      [1] http://docs.oracle.com/javase/7/docs/api/java/lang/Character.html#isTitleCase%28char%29

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sebb Sebb
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: