You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2015/07/19 10:22:04 UTC

[jira] [Commented] (LANG-1142) StringUtils#capitalize: Javadoc says toTitleCase; code uses toUpperCase

    [ https://issues.apache.org/jira/browse/LANG-1142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14632726#comment-14632726 ] 

Henri Yandell commented on LANG-1142:
-------------------------------------

It definitely should use toTitleCase. I wonder when that changed. :(

Looks like it was changed in http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java?r1=1673944&r2=1673943&pathrev=1673944 - https://issues.apache.org/jira/browse/LANG-1058 - which fortunately is unreleased.

> StringUtils#capitalize: Javadoc says toTitleCase; code uses toUpperCase
> -----------------------------------------------------------------------
>
>                 Key: LANG-1142
>                 URL: https://issues.apache.org/jira/browse/LANG-1142
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 3.4
>            Reporter: Sebb
>
> 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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)