JDK-8215401 : Add isEmpty default method to CharSequence
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-12-14
  • Updated: 2020-08-18
  • Resolved: 2020-05-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 15
15 b25Fixed
Related Reports
CSR :  
Duplicate :  
Relates :  
Sub Tasks
JDK-8251953 :  
Adding isEmpty as a default method on CharSequence would harmonize String with other CharSequence implementations.

isEmpty was added to String in Java 1.6, but at the time there was no means to add it to the CharSequence interface without breaking compatibility.
URL: https://hg.openjdk.java.net/jdk/jdk/rev/275c91757a7f User: redestad Date: 2020-05-22 09:26:55 +0000

Implementations of CharSequence in the JDK should be examined to see if they would benefit from providing an override of the new isEmpty() default method. (This can be done in this changeset or in a follow-up changeset, as appropriate.) There should be tests added for the default methods as well as for any overriding methods.