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 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
    • Number of attachments :
      0

      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
          Jim 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
          Jim 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
          blackdrag blackdrag added a comment -

          isn't CharSequence a jdk 1.5 class?

          Show
          blackdrag blackdrag added a comment - isn't CharSequence a jdk 1.5 class?
          Hide
          Jim White added a comment -

          Nope.

          Show
          Jim White added a comment - Nope.
          Jim White made changes -
          Field Original Value New Value
          Link This issue depends upon GROOVY-3287 [ GROOVY-3287 ]
          Jim White made changes -
          Assignee Jim White [ jimwhite ]
          Jim White made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Paul King made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          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:
              Jim White
              Reporter:
              Jim White
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: