Commons Lang
  1. Commons Lang
  2. LANG-277

Javadoc errors on StringUtils.splitPreserveAllTokens(String, char)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor 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", "", ""]

        Activity

        Hide
        Henri Yandell added a comment -

        Thanks for the report Ken.

        The first issue has already been caught and fixed in SVN.

        Second one now fixed (by adding another space to the end of the example).

        svn ci -m "Fixed 2nd javadoc bug mentioned in #LANG-277 and added more unit tests to match the javadoc examples"
        Sending src/java/org/apache/commons/lang/StringUtils.java
        Sending src/test/org/apache/commons/lang/StringUtilsTest.java
        Transmitting file data ..
        Committed revision 438574.

        Show
        Henri Yandell added a comment - Thanks for the report Ken. The first issue has already been caught and fixed in SVN. Second one now fixed (by adding another space to the end of the example). svn ci -m "Fixed 2nd javadoc bug mentioned in # LANG-277 and added more unit tests to match the javadoc examples" Sending src/java/org/apache/commons/lang/StringUtils.java Sending src/test/org/apache/commons/lang/StringUtilsTest.java Transmitting file data .. Committed revision 438574.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development