JDK-8186752 : Era.getDisplayName doesn't work with non-IsoChronology
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.time
  • Priority: P3
  • Status: Closed
  • Resolution: Withdrawn
  • Fix Versions: tbd_minor
  • Submitted: 2017-08-24
  • Updated: 2017-08-25
  • Resolved: 2017-08-25
Related Reports
CSR :  
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)


Comments
CSR is not required on overriding methods in the superclass.
25-08-2017