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

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

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 15
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Interface Kind:
      Java API
    • Scope:
      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

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

                Dates

                Created:
                Updated:
                Resolved: