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

Refine specification of javax.lang.model.element.Modifier::toString

    XMLWordPrintable

Details

    • CSR
    • Status: Closed
    • P4
    • Resolution: Approved
    • 15
    • core-libs
    • None
    • behavioral
    • minimal
    • Java API
    • SE

    Description

      Summary

      Define the behavior of javax.lang.model.element.Modifier::toString in terms of modifier names in the JLS.

      Problem

      Clarifies a situation where the name of the enum constant and the name in the JLS don't just differ by upper/lower case, as for non-sealed.

      Solution

      Change to the spec to be defined in terms of JLS names.

      Specification

            /**
      -     * Returns this modifier's name in lowercase.
      +     * Returns this modifier's name as defined in <cite>The
      +     * Java&trade; Language Specification</cite>.
      +     * The modifier name is the {@linkplain #name() name of the enum
      +     * constant} in lowercase and with any underscores ("{@code _}")
      +     * replaced with hyphens ("{@code -}").
            */
           public String toString() {

      Attachments

        Issue Links

          Activity

            People

              darcy Joe Darcy
              darcy Joe Darcy
              Vicente Arturo Romero Zaldivar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: