RFR: 8291027: Some of TimeZone methods marked 'synchronized' unnecessarily

Andrey Turbanov aturbanov at openjdk.org
Wed Jan 24 20:46:25 UTC 2024


On Wed, 17 Jan 2024 18:19:18 GMT, Naoto Sato <naoto at openjdk.org> wrote:

>> src/java.base/share/classes/java/util/TimeZone.java line 629:
>> 
>>> 627:      */
>>> 628:     public static String[] getAvailableIDs(int rawOffset) {
>>> 629:         return ZoneInfo.getAvailableIDs(rawOffset);
>> 
>> BTW can we call `ZoneInfoFile.getZoneIds` here directly? 
>> `ZoneInfo.getAvailableIDs` bridge seems redudnant.
>
> `TimeZone` is an abstract class, and `ZoneInfo` is an implementation. So to me, it is clearer to call the overriden method in the implementation even though the reason you mentioned.

>From OOP point of view - it's strange to call subclass method from a super class.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17441#discussion_r1465516080


More information about the core-libs-dev mailing list