commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-1193) ordinalIndexOf("abc", "ab", 1) gives incorrect answer of -1 (correct answer should be 0)
Date Fri, 11 Dec 2015 13:47:11 GMT

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

Sebb commented on LANG-1193:
----------------------------

Thanks for the report.  I agree that there is a bug here.

Looks like the problem was introduced as a fix for LANG-1077 (which was invalid).




> ordinalIndexOf("abc", "ab", 1) gives incorrect answer of -1 (correct answer should be
0)
> ----------------------------------------------------------------------------------------
>
>                 Key: LANG-1193
>                 URL: https://issues.apache.org/jira/browse/LANG-1193
>             Project: Commons Lang
>          Issue Type: Bug
>    Affects Versions: 3.4
>         Environment: OS X Yosemite 10.10.5. Maven project.
>            Reporter: Qin Li
>             Fix For: 2.6
>
>
> In Apache Commons Lang 3.4, StringUtils.ordinalIndexOf("abc", "ab", 1) gives incorrect
answer of -1 (correct answer should be 0)。but StringUtils.ordinalIndexOf("abc", "a", 1)
gives correct answer of 0.
> Based on the above mentioned observation, the bug occurrs if the searchStr is of length
> 1, and locates at the index 0 of the str.
> In Apache Commons Lang 2.6, this bug is not observed.



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

Mime
View raw message