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

Locale hashcode synchronization is inadequate

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 5.0
    • 1.4.0
    • core-libs
    • None
    • b28
    • generic
    • generic

        Locale.writeObject sets and reads the hashcode field without any synchronization. As such, even though the hashCode method is synchronized, the hashCode method could return -1 if a separate thread executing writeObject runs in between the assignment and return statements of the hashCode method. And as such, writeObject would write out a value other than -1 if a separate thread executing hashCode runs in between the assignment and defaultWriteObject statements of the writeObject method.

              okutsu Masayoshi Okutsu
              bscheiflsunw Bob Scheifler (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: