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

Optimize empty substring handling

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 15
    • core-libs
    • None
    • behavioral
    • low
    • An application depending on the identity of empty sub-strings could eventually break.
    • Java API
    • Implementation

      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.

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

              Created:
              Updated:
              Resolved: