You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `SimpleDateFormat` format class is not thread safe. Without any type
of synchronization it would be possible for multiple threads to attempt
to format dates at the same time resulting in some odd dates. As the
formatter is a private constant this takes the approach of simply
synchronizing on it. This way we ensure only one thread is using it at a
time.
An alternative approach would be to create a thread local with each
thread having it's own dedicated formatter. I opted to not use this
approach because it is slightly more complicated and each thread would
pay the penalty of initial formatter creation. If it turns out that
there are only a small number of re-used threads which use this class
and the synchronization overhead is too large we can move to that
approach.
This fix is being omitted from the changelog as it does not affect any
external behavior - just potential debug logging information.
0 commit comments