Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.3
-
None
Description
While fixing ROL-1201, I also noticed that the SimpleDateFormat used is shared. This is a well known and documented badness. It's not designed to be safe for sharing across threads.
In the present case calling format() sets an internal Calendar object with the time, yielding unpredictable results in the shared MT case.
All of the IfModified*Filter classes have this bug.
Instantiating SimpleDateFormat with the given expression is a bit expensive, but measurement indicates it takes only about 24 microseconds per instantiation (averaged over 100000 iterations) on my two-year-old home pc. I think we can afford it, and I don't know how many times we are thinking we are missing the cache because of MT access screwing up the result.