We're updating the issue view to help you get more done. 

SimpleDateFormat clone problem

Description

SimpleDateFormat uses a transient char[10] field to do fast numeric formatting. This field should be allocated for each SimpleDateFormat instance, but clone() method does only shallow cloning. Therefore, two SimpleDateFormat instances share the same buffer, and may produce incorrect results when format() method is called from multiple threads.

The same problem is found in an internal class DateNumberFormat (note: DateNumberFormat was created for optimizing decimal formatting, but later, SimpleDateFormat duplicated the logic because of performance reason.)

Environment

Status

Assignee

Yoshito Umaoka

Reporter

Yoshito Umaoka

Labels

tracCc

tkeep

tracCreated

Nov 06, 2014, 6:27 PM

tracOwner

yoshito

tracProject

ICU4J

tracReporter

yoshito

tracResolution

fixed

tracReviewer

tkeep

tracStatus

closed

Components

Fix versions

Priority

critical