JDK-8251953 : Release Note: Added isEmpty Default Method to CharSequence
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 8u471-perf,15,17.0.17-oracle
  • Priority: P4
  • Status: Resolved
  • Resolution: Delivered
  • Submitted: 2020-08-18
  • Updated: 2025-09-19
  • Resolved: 2025-09-19
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 JDK 17 JDK 8
15Resolved 17.0.17-oracleResolved 8u471-perfResolved
Description
`java.lang.CharSequence` has been updated in this release to define a default `isEmpty` method that tests if a character sequence is empty.  Testing for, and filtering out, empty `String`s and other `CharSequence`s is a common occurrence in code and `CharSequence::isEmpty` can be used as a method reference.  Classes that implement `java.lang.CharSequence` and another interface that defines `isEmpty` method should be aware of this addition as they may need to be modified to override the `isEmpty` method.