Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8287860

Revise usage of volatile in j.u.Locale

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 19
    • None
    • core-libs
    • None
    • b26

      - cached hash code of Locale and Locale$LanguageRange shouldn't be volatile, even in case of concurrent access 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()

            stsypanov Sergey Tsypanov
            stsypanov Sergey Tsypanov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: