Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3285

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

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: 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
          paulk 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
          paulk 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).
          Hide
          jimwhite James P. White added a comment -

          Nope.

          Show
          jimwhite James P. White added a comment - Nope.
          Hide
          blackdrag Jochen Theodorou added a comment -

          isn't CharSequence a jdk 1.5 class?

          Show
          blackdrag Jochen Theodorou added a comment - isn't CharSequence a jdk 1.5 class?
          Hide
          jimwhite 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
          jimwhite 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
          paulk Paul King added a comment -

          You mean implement for the 1_5_X branch?

          Show
          paulk Paul King added a comment - You mean implement for the 1_5_X branch?

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development