gwtjsonrpc issue

17 views
Skip to first unread message

Rafael Rabelo

unread,
Feb 16, 2011, 11:06:36 AM2/16/11
to Repo and Gerrit Discussion
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

Shawn Pearce

unread,
Feb 16, 2011, 7:56:54 PM2/16/11
to Rafael Rabelo, Repo and Gerrit Discussion
On Wed, Feb 16, 2011 at 08:06, Rafael Rabelo
<rafael.ra...@sonyericsson.com> wrote:
> During its development, we noticed a problem with
> ChangeInfo.lastUpdatedOn deserialization. Wrong date and time values
> were found (difference of about ten days).
...

> 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?

Ick. gwtjsonrpc is unique to Gerrit. Report bugs to me, and fixes as
patches can be posted to review.source.android.com, project name
tools/gwtjsonrpc.git.

Reply all
Reply to author
Forward
0 new messages