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

Status

Assignee

Yoshito Umaoka

Reporter

Yoshito Umaoka

Labels

Reviewer

None

Time Needed

None

Start date

None

Components

Fix versions

Priority

critical