[ 
https://issues.apache.org/jira/browse/LANG-631?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Henri Yandell closed LANG-631.
------------------------------

    Resolution: Fixed

Current trunk had addressed this, but had transposed the 4 and 5 results. I've 
fixed that in r960831, namely:

     * StringUtils.lastIndexOf("aabaabaa", "a")  = 7
     * StringUtils.lastIndexOf("aabaabaa", "b")  = 5
     * StringUtils.lastIndexOf("aabaabaa", "ab") = 4


> StringUtils JavaDoc contains erroneous examples
> -----------------------------------------------
>
>                 Key: LANG-631
>                 URL: https://issues.apache.org/jira/browse/LANG-631
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 2.5, 3.0
>            Reporter: Maxx
>            Priority: Minor
>   Original Estimate: 0.02h
>  Remaining Estimate: 0.02h
>
> For the method: static int    lastIndexOf(String str, String searchStr) 
> @
> (v2.5): 
> http://commons.apache.org/lang/api-release/org/apache/commons/lang/StringUtils.html#lastIndexOf(java.lang.String,%20java.lang.String)
> (v3.0): 
> http://commons.apache.org/lang/api/org/apache/commons/lang3/StringUtils.html#lastIndexOf(java.lang.String,%20java.lang.String)
> These results are wrong:
>  StringUtils.lastIndexOf("aabaabaa", "a")  = 0
>  StringUtils.lastIndexOf("aabaabaa", "b")  = 2
>  StringUtils.lastIndexOf("aabaabaa", "ab") = 1
> Correct values:
> 1st = 7
> 2nd = 5
> 3rd = 4

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to