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

ChronoField.getName method redundant with ChronoField.name

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • core-libs
    • 8
    • b102
    • generic
    • generic
    • Verified

      ChronoField has overlapping methods; the name method is inherited from Enum
      and getName defined in the TemporalField interface. Enum also defines the valueOf method is the complement to the name method, parsing its output.

      In addition, for Enums the toString method is defined to be the 'programmer-friendly' name of the enum constant.

      The TemporalField.getName and Enum.toString methods have the same function and general description.

      The TemporalField.getName method should be renamed to toString.

      Note that TemporalField.getDisplayName(locale) is also defined to return the localized field name.

            rriggs Roger Riggs
            rriggs Roger Riggs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: