Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8240225

Optimize empty substring handling

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 15
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      An application depending on the identity of empty sub-strings could eventually break.
    • Interface Kind:
      Java API
    • Scope:
      Implementation

      Description

      Summary

      Optimize String.substring and related operations like stripLeading, stripTrailing to avoid redundantly creating a new empty String.

      Problem

      For some inputs, the identity of an empty string returned by String.substring and stripLeading will change with this optimization.

      Solution

      Accept the behavior change and add a release note.

      Specification

      No specification change.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              redestad Claes Redestad
              Reporter:
              redestad Claes Redestad
              Reviewed By:
              Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: