Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1281

Javadoc of StringUtils.ordinalIndexOf is contradictory.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5
    • Fix Version/s: 3.6
    • Component/s: lang.*
    • Labels:
      None

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pascalschumacher Pascal Schumacher
                Reporter:
                aioobe Andreas Lundblad
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: