Why is Java’s SimpleDateFormat not thread-safe? [duplicate]
SimpleDateFormat stores intermediate results in instance fields. So if one instance is used by two threads they can mess each other’s results. Looking at the source code reveals that there is a Calendar instance field, which is used by operations on DateFormat / SimpleDateFormat. For example parse(..) calls calendar.clear() initially and then calendar.add(..). If another … Read more