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

Javadoc errors on StringUtils.splitPreserveAllTokens(String, char)

    XMLWordPrintableJSON

Details

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

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

            Dates

              Created:
              Updated:
              Resolved: