On Mon, 18 Sep 2023 22:42:09 GMT, Justin Lu <j...@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.

This pull request has now been integrated.

Changeset: 496264c1
Author:    Justin Lu <j...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/496264c1f98d313f3df19f919b54c98fc03d88f7
Stats:     149 lines in 9 files changed: 101 ins; 7 del; 41 mod

8316435: sun.util.calendar.CalendarSystem subclassing should be restricted

Reviewed-by: naoto

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

PR: https://git.openjdk.org/jdk/pull/15803

Reply via email to