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

ChronoField.getName method redundant with ChronoField.name

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Introduced In Version:
      8
    • Resolved In Build:
      b102
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: