commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitry Katsubo (JIRA)" <>
Subject [jira] [Updated] (LANG-909) Thread-safe wrapper for SimpleDateFormat
Date Wed, 07 Aug 2013 18:08:49 GMT


Dmitry Katsubo updated LANG-909:


Attaching improved version (formatting applied, testing improved, added delegating setters/getters).

I also attach the adapter for current {{FastDateFormat}} and {{FastDateParser}} and testing
these implementations via adapter (which I have referred in my last comment).

{{FastDateParser}} in general services my needs, as I only work with Gregorian calendar. For
other calendars JavaDoc says it delegates parsing to {{SimpleDateFormat}} (I have not found
this place in code), thus for these calendars {{ThreadSafeSimpleDateFormat}} is (potentially)
faster as it shares same {{SimpleDateFormat}} instance within a thread.

Does anyone has measurements on how {{FastDateParser}} is faster then {{SimpleDateFormat}}?
> Thread-safe wrapper for SimpleDateFormat
> ----------------------------------------
>                 Key: LANG-909
>                 URL:
>             Project: Commons Lang
>          Issue Type: New Feature
>          Components: lang.time.*
>    Affects Versions: 3.1
>            Reporter: Dmitry Katsubo
>            Priority: Minor
>         Attachments:,,
> {{SimpleDateFormat}} implementation in JDK is known to be [not thread-safe|].
The attached helper class solves the problem by holding a separate instance of {{SimpleDateFormat}}
per thread.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message