Details
-
CSR
-
Resolution: Withdrawn
-
P4
-
None
-
behavioral
-
minimal
-
Innocuous override of existing default method added to the superinterface.
-
Java API
-
SE
Description
Summary
Provide an method explicitly corresponding to the "empty name" concept mentioned repeated in the javax.lang.model
API.
Problem
The javax.lang.model
API repeatedly uses the concept of an "empty name." With the CharSequence
superinterface of Name
having an isEmpty
default method as of 15, it is helpful to have an innocuous override fo isEmpty
is Name
to ease references to the empty name concept from other parts of the API.
Solution
Add an innocuous override of CharSequence::isEmpty
to javax.lang.model.Name
.
Specification
public interface Name extends CharSequence {
/**
+ * Returns {@code true} if this is an empty name with a length of
+ * zero; returns {@code false} otherwise.
+ * @return {@code true} for an empty name and {@code false} otherwise.
+ *
+ * @implSpec Returns the result of calling {@link
+ * CharSequence#isEmpty() CharSequence.isEmpty()}.
+ * @since 16
+ */
+ @Override
+ default boolean isEmpty() {
+ return CharSequence.super.isEmpty();
+ }
Attachments
Issue Links
- csr of
-
JDK-8248983 Add links to definition of empty name
- Resolved