Integrated: 8287860: Revise usage of volatile in j.u.Locale
Сергей Цыпанов
duke at openjdk.java.net
Tue Jun 7 11:50:22 UTC 2022
On Mon, 6 Jun 2022 12:58:39 GMT, Сергей Цыпанов <duke at openjdk.java.net> wrote:
> - cached hash code of `Locale` and `Locale$LanguageRange` shouldn't be volatile, even in case of race in the worst case it is recalculated at most once per thread
> - `defaultLocale` field is read multiple times in `initDefault()`
> - `isoLanguages` is accessed multiple times in `getISOLanguages()`
> - `languageTag` is read twice in `toLanguageTag()`
This pull request has now been integrated.
Changeset: 4fe0ca9e
Author: Sergey Tsypanov <sergei.tsypanov at yandex.ru>
Committer: Naoto Sato <naoto at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/4fe0ca9ec3b995eb113ac214219cae22f83333c9
Stats: 24 lines in 2 files changed: 5 ins; 0 del; 19 mod
8287860: Revise usage of volatile in j.u.Locale
Reviewed-by: naoto
-------------
PR: https://git.openjdk.java.net/jdk/pull/9041
More information about the core-libs-dev
mailing list