For the official source code for SafeSimpleDateFormat, visit : https://github.com/jdereg/java-util
Include the following dependency section in your pom.xml to add SafeSimpleDateFormat to your project.
com.cedarsoftware java-util 1.8.0
This code allows you to use a SimpleDateFormat in a thread-safe manner. SimpleDateFormat has the fundamental flaw in that it is not thread-safe. I"ve fixed many bugs in server code where a developer stored a SimpleDateFormat in a member variable, session, static, etc. not realizing that this will cause bugs.
The bugs range from sporadic NumberFormatExceptions, ArrayOutOfBoundsExceptions, and the worst case scenario - a date that is formatted correctly, but with the wrong values. Ever wonder why banks sometimes make an error?
There are three (3) approaches commonly use