lundi 29 octobre 2018

Java : Formats are generally not synchronized.




From JavaDoc :

Formats are generally not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently, it must be synchronized externally.

 It allows for formatting (date -> text), parsing (text -> date), and normalization
Date formats are not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently, it must be synchronized externally.


If using Java 8, it's better to use thread-safe

DateTimeFormatter

Aucun commentaire:

Enregistrer un commentaire

to criticize, to improve