<i18n dev> RFR: 8347949: Currency method to stream available Currencies [v2]
Naoto Sato
naoto at openjdk.org
Fri Jan 17 22:14:35 UTC 2025
On Thu, 16 Jan 2025 22:39:52 GMT, Justin Lu <jlu at openjdk.org> wrote:
>> Please review this PR and CSR which adds a method to _java.util.Currency_ which returns a stream of the available Currencies.
>>
>> The motivation can be found in the CSR.
>
> Justin Lu has updated the pull request incrementally with one additional commit since the last revision:
>
> synchronize init method over block
Looks good.
src/java.base/share/classes/java/util/Currency.java line 467:
> 465: private static synchronized void initAvailableCurrencies() {
> 466: if (available == null) {
> 467: available = new HashSet<>(256);
Not related to your change, but this should be `HashSet.newHashSet(256)`. In fact 256*0.75 is 192, which is smaller than the current number of currencies (230, as of JDK24)
-------------
PR Review: https://git.openjdk.org/jdk/pull/23165#pullrequestreview-2560069311
PR Review Comment: https://git.openjdk.org/jdk/pull/23165#discussion_r1920818979
More information about the i18n-dev
mailing list