<i18n dev> RFR: 8347949: Currency method to stream available Currencies [v5]

Justin Lu jlu at openjdk.org
Thu Jan 23 02:50:46 UTC 2025


On Wed, 22 Jan 2025 18:37:32 GMT, Justin Lu <jlu at openjdk.org> wrote:

>> I'm not sure how useful it is to optimize the performance of `availableCurrencies` access to "available", but adding volatile will slow every access down.
>> The computation of the available currencies is stable, so a race computing it is benign.
>> Except for the available hashSet being partially filled when read by the thread calling `getAvailableCurrencies()`.
>> That could be remedied by using a new local for the new HashSet in initAvailableCurrencies and assigning to available only when the set is completely initialized.
>> (And yes, this looks like a good fit for stable values.)
>
> How about I revert the most recent commit and have this PR simply deliver the change to provide the stream of currencies. I'll file another issue to improve `available` to use stable values when that is available. Does that sound fine?

Reverted in https://github.com/openjdk/jdk/pull/23165/commits/ade21c923369d0f0423335c3073e2c615adf050c. Filed [JDK-8348351](https://bugs.openjdk.org/browse/JDK-8348351) to implement `available` as a stable value when applicable.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23165#discussion_r1926283835


More information about the i18n-dev mailing list