julman99 / gson-fire

A java library that adds some very useful features to Gson, like Date serializing to unix timestamp or RFC3339, method (getters) serialization, pre/post processors and many others. Check out the documentation to learn how to use it!
http://gsonfire.io
Other
229 stars 37 forks source link

DateRFC3339TypeAdapter is not thread-safe #24

Closed npanasenko closed 8 years ago

npanasenko commented 8 years ago

Weird bugs appeared in my application when DateRFC3339TypeAdapter was called simultaneously from different Threads. The RFC3339DateFormat seems to cause the problem.

julman99 commented 8 years ago

Thanks for reporting this, I will check during the weekend.

Can you be more specific on what kind of bugs you got? serialization bugs? weird exceptions?

npanasenko commented 8 years ago

When multiple threads deserialize dates concurrently it is possible that the Threads return due to racing conditions wrong dates, sometimes the result of the other thread.

julman99 commented 8 years ago

Please try version 1.5.0 and let me know if it fixes the issue

Thanks!