<i18n dev> RFR: 8347955: TimeZone methods to stream the available timezone IDs [v3]
Justin Lu
jlu at openjdk.org
Thu Jan 23 22:25:49 UTC 2025
On Thu, 23 Jan 2025 20:04:04 GMT, Chen Liang <liach at openjdk.org> wrote:
>> Justin Lu has updated the pull request incrementally with one additional commit since the last revision:
>>
>> include copyright bump for missed file in JDK-834836501
>
> src/java.base/share/classes/java/util/TimeZone.java line 659:
>
>> 657: * @since 25
>> 658: */
>> 659: public static synchronized Stream<String> availableIDs(int rawOffset) {
>
> Why are these new methods synchronized? I think the streams and the spliterators are late-binding, so the synchronization does not synchronize the access to the underlying arrays. synchronized modifier also does not appear in Javadoc and is not part of the API surface, so it can be safely removed.
Right, it can be removed. Actually, I think `getAvailableIDs()` and `getAvailableIDs(int)` also do not need to be synchronized. The internal IDs are eagerly initialized in the static block of `ZoneInfoFile.java` and are effectively final and not modified.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23251#discussion_r1927760206
More information about the i18n-dev
mailing list