Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2163870 | 1.3.1 | Unassigned | P5 | Closed | Duplicate |
Name: boT120536 Date: 04/22/2001
Here is source code version:
/*
* @(#)DecimalFormat.java 1.57 00/01/19
*
* Copyright 1996-2000 Sun Microsystems, Inc. All Rights Reserved.
*
* This software is the proprietary information of Sun Microsystems, Inc.
* Use is subject to license terms.
*
*/
The routing java.text.DecimalFormat is not thread safe.
We are facing problems when concurrent accesses are done to a single
SimpleDateFormat for parsing a date with format "yyMMddHHmmss".
The stack trace is:
java.lang.NumberFormatException:
at java.lang.Long.parseLong(Long.java:331)
at java.lang.Long.parseLong(Long.java:363)
at java.text.DigitList.getLong(DigitList.java:153)
at java.text.DecimalFormat.parse(DecimalFormat.java:808)
at java.text.SimpleDateFormat.subparse(SimpleDateFormat.java:987)
at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:708)
...
After many investigations and examination of Java core libray source code as
provided with JBuilder Entreprise edition 4.0, I reached the following
diagnostic.
The accesses to the private 'digitList' field should be protected through
critical section. It is the case at line 441 and 498 in DecimalFormat.java
However, there is a LACK of critical section between line 793 (which is setting
digitList) and line 808 (which is using it). It should guarranteed that no
acces can be performed by a concurrentely running thread that would reset or
modify the digitList field betwezen those lines.
(Review ID: 120972)
======================================================================
- backported by
-
JDK-2163870 [Fmt-Nu] DecimalFormat.parse is not thread-safe
- Closed
- duplicates
-
JDK-4699765 java.text.DigitList throws ArrayOutOfBoundsException
- Closed
-
JDK-4264153 format classes are not thread-safe, and not documented as such
- Resolved
- relates to
-
JDK-4407042 SimpleDateFormat clone() decendents corrupt each other
- Resolved
-
JDK-4101500 java.text.NumberFormat is not thread safe
- Closed
-
JDK-4228335 SimpleDateFormat is not threadsafe (one more try)
- Closed
(1 relates to)