<i18n dev> RFR: JDK-8316435: sun.util.calendar.CalendarSystem subclassing should be restricted [v5]

Naoto Sato naoto at openjdk.org
Wed Sep 20 17:17:43 UTC 2023


On Wed, 20 Sep 2023 07:00:23 GMT, Justin Lu <jlu at openjdk.org> wrote:

>> Please review this PR which restricts sub-classing of the internal calendar system in sun.util.calendar to only the existing implementations. Drive by cleanup included.
>> 
>> As the implementation is long-standing and complete with no intent for future sub-classing, the CalendarSystem should be made sealed. Modifiers adjusted accordingly (`JulianCalendar.Date` must now have package visibility).
>> 
>> 
>> This system has the following structure,
>> 
>> `CalendarSystem` extended by `AbstractCalendar` extended by `BaseCalendar` extended by 
>> (`Gregorian, JulianCalendar, LocalGregorianCalendar`)
>> 
>> `CalendarDate` extended by `BaseCalendar.Date` extended by 
>> (`Gregorian.Date, ImmutableGregorianDate, JulianCalendar.Date, LocalGregorianCalendar.Date`)
>> 
>> Additionally, CalendarUtils was made `final`, as it is a utility class composed of static util methods.
>
> Justin Lu has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - cleanup CalendarDate after revert
>  - Revert "Replace sprintf0d with Formatter"
>    
>    This reverts commit 84a346aed2be262b717f82fbbc32a4ed0323bccc.

LGTM

-------------

Marked as reviewed by naoto (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15803#pullrequestreview-1636151330


More information about the i18n-dev mailing list