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

Naoto Sato naoto at openjdk.org
Wed Jan 17 18:21:51 UTC 2024


On Tue, 16 Jan 2024 11:12:44 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

>> 8291027: Some of TimeZone methods marked 'synchronized' unnecessarily
>
> 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.

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

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


More information about the core-libs-dev mailing list