I think I've run across a known bug 
(https://code.google.com/p/google-web-toolkit/issues/detail?id=5926). I 
only wish I hadn't spent so long puzzling over it.

I had been hand-rolling my server-side JSON, but as I would refactor 
interfaces, I found the JSON key strings on the server getting out-of-sync 
with my client side methods. After reading more on AutoBean, I figured I 
could create objects with the as() method, populate them, and then dump the 
payload back to my client. It looked slicker, and, if a method name was 
changed, Eclipse would do the work of updating stuff I might miss until I 
compiled and ran it. (And I'm using as() in my unit tests to avoid the time 
spent with a GWT.create() call.)

For me this works fine with small objects, like a hand full of keys and 
maybe one small JSONArray. However when I attempted to create a much 
larger, more complex object--more keys, longers lists, and lists within 
lists, etc.--I'm seeing all sorts of bugs:  A 13-member list with all 
members the same (the last value added), *many* fields missing in the JSON 
payload (upwards of hal!), and in one case, a setter method for a boolean 
that crashes with an IllegalArgumentException when called with a boolean!

So far this on the server side (and Issue #5926 is specifically server). 
Since I dunno where the tipping point is, I'm going to pull *all* my server 
side AutoBean and, once again, hand-roll the JSON.

Someone with access may want to annotate the AutoBean 
wiki<https://code.google.com/p/google-web-toolkit/wiki/AutoBean>with this 
issue. Sucn a note may have saved me a lot of work.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to