United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4518797 Locale hashcode synchronization is inadequate
JDK-4518797 : Locale hashcode synchronization is inadequate

Details
Type:
Bug
Submit Date:
2001-10-24
Status:
Resolved
Updated Date:
2003-11-05
Project Name:
JDK
Resolved Date:
2003-11-05
Component:
core-libs
OS:
generic
Sub-Component:
java.util:i18n
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.4.0
Fixed Versions:
5.0 (b28)

Related Reports
Backport:
Backport:

Sub Tasks

Description
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.

                                    

Comments
EVALUATION

Removed synchronized from hashCode and use a transient field to keep a hash code. 'hashcode' is kept for compatibility.
###@###.### 2003-10-30
                                     
2003-10-30
PUBLIC COMMENTS

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.
                                     
2004-06-10
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger-beta

FIXED IN:
tiger-beta

INTEGRATED IN:
tiger-b28
tiger-beta


                                     
2004-06-14



Hardware and Software, Engineered to Work Together