Groovy
  1. Groovy
  2. GROOVY-3285

Implement String.replace(CharSequence, CharSequence), a JDK 1.5 method, for backwards compatibility

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6-rc-1
    • Fix Version/s: 1.6-rc-2, 1.5.8
    • Component/s: None
    • Labels:
      None

      Description

      JDK 1.5 introduced String.replace(CharSequence, CharSequence), which is effectively what folks often expect String.replaceAll(String, String) (a JDK 1.4 method) to do, which is do literal string replacement.

        Issue Links

          Activity

          Hide
          Paul King added a comment -

          You mean implement for the 1_5_X branch?

          Show
          Paul King added a comment - You mean implement for the 1_5_X branch?
          Hide
          James P. White added a comment - - edited

          Yeah. Too annoying to write the tests for JDK 1.4 otherwise.

          Also turns out I've hit a bug in String.replaceAll in JDK 1.4 that appears when there is a backslash in between \Q...\E. Implementing a workaround in RegexUtils.quote now...

          Show
          James P. White added a comment - - edited Yeah. Too annoying to write the tests for JDK 1.4 otherwise. Also turns out I've hit a bug in String.replaceAll in JDK 1.4 that appears when there is a backslash in between \Q...\E . Implementing a workaround in RegexUtils.quote now...
          Hide
          Jochen Theodorou added a comment -

          isn't CharSequence a jdk 1.5 class?

          Show
          Jochen Theodorou added a comment - isn't CharSequence a jdk 1.5 class?
          Hide
          James P. White added a comment -

          Nope.

          Show
          James P. White added a comment - Nope.
          Hide
          Paul King added a comment -

          I am not sure this was needed for the 1_6_X branch as when running under a 1.4 JVM I think we will get the retrotranslated version of String.replaceAll(CharSequence, CharSequence).

          Show
          Paul King added a comment - I am not sure this was needed for the 1_6_X branch as when running under a 1.4 JVM I think we will get the retrotranslated version of String.replaceAll(CharSequence, CharSequence).

            People

            • Assignee:
              James P. White
              Reporter:
              James P. White
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development