StdDateFormat - thread safe?

29 views
Skip to first unread message

Corneliu Creanga

unread,
Jan 14, 2020, 2:02:56 PM1/14/20
to jackson-dev
Hello,

Is StdDateFormat safe to use in a multithreaded environment? I've seen that the parse method is using internally the java.util.Calendar (not thread safe) so I think it's not - am I right?

Thanks,
Cornel.

Tatu Saloranta

unread,
Jan 14, 2020, 2:11:28 PM1/14/20
to jacks...@googlegroups.com
On Tue, Jan 14, 2020 at 11:03 AM Corneliu Creanga <cornel...@gmail.com> wrote:
Hello,

Is StdDateFormat safe to use in a multithreaded environment? I've seen that the parse method is using internally the java.util.Calendar (not thread safe) so I think it's not - am I right?


This is bit of an open-ended question for general usage -- and this class is NOT designed to be used outside Jackson itself -- but for usage by jackson-databind itself, yes, it is thread-safe. It is an implementation detail and you should not really need to know or care about its existence: it's there just to handle reading and writing of java.util.Calendar and java.util.Date values when handling String-values.

-+ Tatu +-


 

Corneliu Creanga

unread,
Jan 14, 2020, 2:49:36 PM1/14/20
to jackson-dev
Thanks Tatu. 
Reply all
Reply to author
Forward
0 new messages