commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (LANG-1281) Javadoc of StringUtils.ordinalIndexOf is contradictory.
Date Thu, 03 Nov 2016 22:19:58 GMT


ASF GitHub Bot commented on LANG-1281:

Github user PascalSchumacher commented on the issue:
    `...incrementing the starting index by one after each successful match, so matches may
overlap.` For empty String there is no match, so no incrementing is done.
    Please do not hesitate to suggest better solution for this issue. Thanks!

> Javadoc of StringUtils.ordinalIndexOf is contradictory.
> -------------------------------------------------------
>                 Key: LANG-1281
>                 URL:
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 3.5
>            Reporter: Andreas Lundblad
>            Priority: Minor
> Javadoc of StringUtils.ordinalIndexOf states the following:
> "The code increments the starting index by one, rather than by the length of the match
string, so matches may overlap."
> But then gives the following example:
> StringUtils.ordinalIndexOf("aabaabaa", "", 2) = 0
> which clearly indicates that it does *not* increment the starting index by one in case
of the empty string.

This message was sent by Atlassian JIRA

View raw message