From: Lin W. <sup...@gm...> - 2013-07-12 09:19:14
|
The javadoc of ISODateTimeFormat class says it's thread-safe and immutable. The static fields are lazily initialized. However it seems it's not done in a thread-safe manner. For example, dt is lazily initialized in public static DateTimeFormatter dateTime() { if (dt == null) { dt = new DateTimeFormatterBuilder() .append(date()) .append(tTime()) .toFormatter(); } return dt; } When there are two threads both inside this method, is it possible that one thread sees an unsafely published non-null dt value due to cache incoherence? Did I miss something? |