You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2015/06/05 19:24:01 UTC

[jira] [Commented] (LANG-1059) Capitalize javadoc is incorrect

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

Sebb commented on LANG-1059:
----------------------------

@Bruno: Huh? Why should the methods need changing? 

As I read it, the problem is that the phrase "first letter" is ambiguous. 
It could mean String.charAt(0), i.e. the "first character" of the string, or it could mean the first letter which is found when scanning the string.

The code actually operates on charAt(0), so it operates on the "first character" of the string.

So I agree with the OP, the Javadoc needs to be clarified.

> Capitalize javadoc is incorrect
> -------------------------------
>
>                 Key: LANG-1059
>                 URL: https://issues.apache.org/jira/browse/LANG-1059
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>    Affects Versions: 3.3.2
>            Reporter: Colin Casey
>            Priority: Minor
>
> The below also applies to uncapitalize.
> Currently the javadocs say:
> bq. Capitalizes a String changing the first letter to title case as per Character.toTitleCase(char). No other letters are changed.
> A more accurate description would be: 
> bq. Capitalizes a String changing the first *character* to title case as per Character.toTitleCase(char). No other letters are changed.
> capitalize("'word'") is an example where the current docs are false (note single-quote is first character but not first letter and nothing gets capitalized)
> This may in fact be a bug if the current docs are correct.



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