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

Javadoc errors on StringUtils.splitPreserveAllTokens(String, char)

    Details

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

      Description

      In the Javadoc for StringUtils.splitPreserveAllTokens(String, char) there are a couple of mistakes. I didn't check for similar mistakes in the similar functions with different signatures.

      StringUtils.splitPreserveAllTokens("a..b.c", '.') = ["a", "b", "c"]

      should read

      StringUtils.splitPreserveAllTokens("a..b.c", '.') = ["a", "", "b", "c"]

      These two lines have the same input giving different outputs. I think that the input string on the second call should be "a b c ".

      StringUtils.splitPreserveAllTokens("a b c ", ' ') = ["a", "b", "c", ""]
      StringUtils.splitPreserveAllTokens("a b c ", ' ') = ["a", "b", "c", "", ""]

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kgeis Ken Geis
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: