cogcomp-nlp
cogcomp-nlp copied to clipboard
FastDateFormat.parse thread safety problem.
https://github.com/CogComp/cogcomp-nlp/blob/master/ner/src/main/java/edu/illinois/cs/cogcomp/ner/StringStatisticsUtils/MyString.java#L48
df.parse(s,pp) is probably not thread-safe when reusing ParsePosition on different strings. Calling this function concurrently cause some undefined behaviors (unexpected exceptions) for me. It may be safer to add a sync block to this function or use a new instance of ParsePosition.