JDK-8249005 : Add Name.isEmpty
  • Type: CSR
  • Component: core-libs
  • Sub-Component: javax.lang.model
  • Priority: P4
  • Status: Closed
  • Resolution: Withdrawn
  • Fix Versions: 16
  • Submitted: 2020-07-08
  • Updated: 2020-07-20
  • Resolved: 2020-07-20
Related Reports
CSR :  
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();
    +    }


Comments
Withdrawing the request as the underlying issue was resolved without the need to add a method.
20-07-2020

Adding [~jlaskey] as a reviewer per https://mail.openjdk.java.net/pipermail/compiler-dev/2020-July/014716.html.
08-07-2020