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

          James P. White created issue -
          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.
          James P. White made changes -
          Field Original Value New Value
          Link This issue depends upon GROOVY-3287 [ GROOVY-3287 ]
          James P. White made changes -
          Assignee Jim White [ jimwhite ]
          James P. White made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          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).
          Mark Thomas made changes -
          Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
          Mark Thomas made changes -
          Workflow jira [ 12732282 ] Default workflow, editable Closed status [ 12744113 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
          Mark Thomas made changes -
          Workflow jira [ 12970135 ] Default workflow, editable Closed status [ 12977912 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          4h 10m 1 James P. White 15/Jan/09 19:40
          Resolved Resolved Closed Closed
          7d 1h 54m 1 Paul King 22/Jan/09 21:34

            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