You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "John Lindwall (JIRA)" <ji...@apache.org> on 2012/10/08 23:44:02 UTC

[jira] [Created] (LANG-844) StringUtils.center() methods have inaccurate examples in javadocs

John Lindwall created LANG-844:
----------------------------------

             Summary: StringUtils.center() methods have inaccurate examples in javadocs
                 Key: LANG-844
                 URL: https://issues.apache.org/jira/browse/LANG-844
             Project: Commons Lang
          Issue Type: Bug
          Components: lang.*
    Affects Versions: 3.1, 2.x
            Reporter: John Lindwall
            Priority: Minor


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)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (LANG-844) StringUtils.center() methods have inaccurate examples in javadocs

Posted by "John Lindwall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Lindwall updated LANG-844:
-------------------------------

    Attachment: StringUtils_Javadoc_Errors_In_Center.patch

A patch for the bug.  Fixes the javadoc comments in StringUtil so that the examples provided are correct.

No new unit test added, since the examples are already present in the existing unit test.

                
> StringUtils.center() methods have inaccurate examples in javadocs
> -----------------------------------------------------------------
>
>                 Key: LANG-844
>                 URL: https://issues.apache.org/jira/browse/LANG-844
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 3.1, 2.x
>            Reporter: John Lindwall
>            Priority: Minor
>         Attachments: StringUtils_Javadoc_Errors_In_Center.patch
>
>
> 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)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (LANG-844) StringUtils.center() methods have inaccurate examples in javadocs

Posted by "John Lindwall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Lindwall updated LANG-844:
-------------------------------

    Affects Version/s:     (was: 3.1)
                       3.x
    
> StringUtils.center() methods have inaccurate examples in javadocs
> -----------------------------------------------------------------
>
>                 Key: LANG-844
>                 URL: https://issues.apache.org/jira/browse/LANG-844
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 3.x, 2.x
>            Reporter: John Lindwall
>            Priority: Minor
>         Attachments: StringUtils_Javadoc_Errors_In_Center.patch
>
>
> 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)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (LANG-844) StringUtils.center() methods have inaccurate examples in javadocs

Posted by "Thomas Neidhart (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Neidhart resolved LANG-844.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 3.2

Patch applied in r1396313.

Thanks for the report and patch!
                
> StringUtils.center() methods have inaccurate examples in javadocs
> -----------------------------------------------------------------
>
>                 Key: LANG-844
>                 URL: https://issues.apache.org/jira/browse/LANG-844
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 3.x, 2.x
>            Reporter: John Lindwall
>            Priority: Minor
>             Fix For: 3.2
>
>         Attachments: StringUtils_Javadoc_Errors_In_Center.patch
>
>
> 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)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira