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

Era.getDisplayName doesn't work with non-IsoChronology

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Withdrawn
    • Fix Version/s: tbd_minor
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      source
    • Compatibility Risk:
      minimal
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Implement Era.getDisplayName() in each subclass of Era.

      Problem

      The default implementation of Era.getDisplayName doesn't work with non-IsoChronology because DateTimeFormatterBuilder.TextPrinterParser.format fails to get the Chronology of the Era.

      Solution

      In each subclass/enum of java.time.chrono.Era, override Era.getDisplayName() and return appropriate display name for the era, depending on its style and locale.

      Specification

      In java.time.chrono.{Hijrah|ThaiBuddhist|Minguo}Era enums, add the following method:

      /**
        * {@inheritDoc}
        *
        * @param style {@inheritDoc}
        * @param locale {@inheritDoc}
        */
      @Override
      public String getDisplayName(TextStyle style, Locale locale)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                naoto Naoto Sato
                Reporter:
                okutsu Masayoshi Okutsu
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: