Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8249005

Add Name.isEmpty

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Withdrawn
    • Fix Version/s: 16
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Innocuous override of existing default method added to the superinterface.
    • Interface Kind:
      Java API
    • Scope:
      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

            Activity

              People

              Assignee:
              darcy Joe Darcy
              Reporter:
              darcy Joe Darcy
              Reviewed By:
              Jim Laskey
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: