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

Javadoc of StringUtils.ordinalIndexOf is contradictory.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.5
    • 3.6
    • lang.*
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: