RFR: 8313813: Field sun.util.calendar.CalendarDate#forceStandardTime is never set [v5]

Naoto Sato naoto at openjdk.org
Sat Sep 16 23:30:43 UTC 2023


On Sat, 16 Sep 2023 07:37:37 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

>> src/java.base/share/classes/sun/util/calendar/ImmutableGregorianDate.java line 160:
>> 
>>> 158:         unsupported();
>>> 159:     }
>>> 160: 
>> 
>> This removal does not look right. The class claims `immutable`, and yet it is now allowing setting the locale.
>
> There is no `setLocale` method in the base class anymore. So, it's not possible to set locale in any classes which extend `BaseCalendar.Date`, including `ImmutableGregorianDate`

It is ok then. (missed the removal of the method in the abstract class). Now come to think of it, I would like them to be `sealed` to make sure they are not randomly subclassed, but that clean-up is for another day.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15726#discussion_r1328020279


More information about the core-libs-dev mailing list