cogcomp-nlp icon indicating copy to clipboard operation
cogcomp-nlp copied to clipboard

FastDateFormat.parse thread safety problem.

Open haowu40 opened this issue 8 years ago • 0 comments

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.

haowu40 avatar Aug 05 '17 20:08 haowu40