Re: [jackson-user] Set DateFormat

2016-10-13 Thread Mohan Radhakrishnan
I find this in DateDeserializers.java synchronized (_customFormat) { try { return _customFormat.parse(str); } catch (ParseException e) { return (java.util.Date) ctxt.handleWeirdStringValue(handledType(), str, "expected format \"%s\"", _formatString); } } Isn't it synchronized here ? Mohan On T

Re: [jackson-user] Set DateFormat

2016-10-12 Thread Tatu Saloranta
On Wed, Oct 12, 2016 at 12:01 AM, Mohan Radhakrishnan < radhakrishnan.mo...@gmail.com> wrote: > First question based on your reply. > > >>Usage of `DateFormat` itself is synchronized such that this aspect > itself is not problematic > > The code synchronizes 'DateFormat' when mapping data across m

Re: [jackson-user] Set DateFormat

2016-10-12 Thread Mohan Radhakrishnan
I was asking because java.time.format.DateTimeFormatter has this property. A formatter created from a pattern can be used as many times as necessary, it is immutable and is thread-safe. Mohan On Wednesday, 12 October 2016 12:31:07 UTC+5:30, Mohan Radhakrishnan wrote: > > First question based on

Re: [jackson-user] Set DateFormat

2016-10-12 Thread Mohan Radhakrishnan
First question based on your reply. >>Usage of `DateFormat` itself is synchronized such that this aspect itself is not problematic The code synchronizes 'DateFormat' when mapping data across multiple threads ? Where exactly is this done ? Thanks, Mohan On Wednesday, 12 October 2016 03:07:41

Re: [jackson-user] Set DateFormat

2016-10-11 Thread Tatu Saloranta
It means that `ObjectMapper` is only thread-safe when ALL configuration is done first, before any usage. This includes, but is not limited to, configuring default `DateFormat` to use. Usage of `DateFormat` itself is synchronized such that this aspect itself is not problematic, rather, settings of `