I recently realized/learned that SimpleDateFormat
has some serious issues and since Java 8 should not be used anymore. I mean... I kind of knew it but never payed much attention to that. So far so good.
But then OK... I have lots of legacy code written in the last 7-8 years which does use SimpleDateFormat
, stores many SimpleDateFormat
objects as static fields, and uses them to parse/format dates. And actually I've never had any issues with these SimpleDateFormat
instances (static or not) in production (for all these years).
So... I want to now review and analyze this legacy code and see if there are really any dangerous uses of SimpleDateFormat
in it.
Therefore my question is...
Under what scenarios exactly is SimpleDateFormat
problematic to use?
Can I get some sort of checklist so that I review my old code and see if any of my scenarios are in that "try to avoid" list?