JDK-8240225 : Optimize empty substring handling
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 15
  • Submitted: 2020-02-28
  • Updated: 2020-03-03
  • Resolved: 2020-03-03
Related Reports
CSR :  
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.


Comments
As noted, the proper procedure is to push a change after the CSR is reviewed and approved. Retroactively moving this request to Approved conditional on a release note being written.
03-03-2020

This change has already been pushed for this. A release note could be useful although I don't expect there is a lot of code depending on implementation details like this.
28-02-2020