Hi.
I am part of the team developing "Shared dashboard for internal and
external servers" [1] .
During its development, we noticed a problem with
ChangeInfo.lastUpdatedOn deserialization. Wrong date and time values
were found (difference of about ten days).
The problem happened when getting dashboard of an "external" server
from an "internal" server. The code to get data from "external" server
was added on com.google.gerrit.httpd.rpc.ChangeListServiceImpl class.
We used Gson to get "external" server data, gwtjsonrpc-1.2.3.jar used.
We based our code on Mylyn Connector solution [2].
According to our investigation JsonServlet.defaultGsonBuilder
registered SqlTimestampDeserializer adapter to java.sql.Timestamp
class. SqlTimestampDeserializer.deserialize parsed timestamp string
using java.text.SimpleDateFormat. This made a timestamp value to be
misunderstood.
To solve the issue, we have created a custom serializer, deserializing
the timestamp string using the
JavaSqlTimestamp_JsonSerializer.parseTimestamp (also available on
gwtjsonrpc-1.2.3.jar). We have also created a method similar to
JsonServlet.defaultGsonBuilder, associating our custom serializer to
java.sql.Timestamp. Just a workaround.
Has anyone found something like this? Assuming we really found an
issue, should I report it in gwt issue tracking or is there a specific
one to gwtjsonrpc?
Thanks.
Rafael
[1]
http://groups.google.com/group/repo-discuss/browse_thread/thread/b92152adab66e15d
[2]
http://groups.google.com/group/repo-discuss/browse_thread/thread/442e31350542311b