This content has been marked as final. Show 3 replies
Even if it were/is being shared, it wouldn't make a difference. That method act only on the input and is thread safe (unless, maybe, in some other thread you were modifying timezones and the like in the middle of a parse, but as long as all you're doing is parse and format, you needn't worry).
Edit: How are you determining that the date string that throws that exception is valid?
DrClap wrote:Okay, I stand corrected, however, I still think that as long as you are not changing timezones, patterns, etc, that it is safe. I could easily be wrong, though.
From the API documentation for SimpleDateFormat:
"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."
Edit: @OP It might help to see the code in question.