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

StringUtils.replaceEachRepeatedly("aaa", new String[]{"aa"}, new String[]{"aXa"}); throw an exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.6
    • Review Patch
    • lang.*
    • None
    • jdk 1.6.24, windows xp pro sp3, eclipse helios

    Description

      After executing line

      StringUtils.replaceEachRepeatedly("aaa", new String[]

      {"aa"}

      , new String[]

      {"aXa"}

      );

      exception is thrown:

      Exception in thread "main" java.lang.IllegalStateException: TimeToLive of -1 is less than 0: aXaXa
      at org.apache.commons.lang.StringUtils.replaceEach(StringUtils.java:3986)
      at org.apache.commons.lang.StringUtils.replaceEach(StringUtils.java:4099)
      at org.apache.commons.lang.StringUtils.replaceEach(StringUtils.java:4099)
      at org.apache.commons.lang.StringUtils.replaceEachRepeatedly(StringUtils.java:3920)

      Attachments

        1. LANG-686.patch
          11 kB
          Thomas Neidhart

        Activity

          People

            Unassigned Unassigned
            qed qed
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: