- 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()`

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

Commit messages:
 - 8287860: Revise usage of volatile in j.u.Locale

Changes: https://git.openjdk.java.net/jdk/pull/9041/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=9041&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8287860
  Stats: 12 lines in 2 files changed: 3 ins; 0 del; 9 mod
  Patch: https://git.openjdk.java.net/jdk/pull/9041.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/9041/head:pull/9041

PR: https://git.openjdk.java.net/jdk/pull/9041

Reply via email to