Reviewers: jat,

Description:
External issue 4140 points out a bug in how we serialize enhanced
objects.  In this case, the .gwt.rpc files end up inconsistent with one
another -- one contains the @ClientFields annotation but the other does
not.  This results in the generated field deserializer expecting a
String to be present in the stream, while the server-side serializer
does not know to create it.

The fix is to be more liberal about including the @ClientFields
annotation, so both client and server will have or not have it
consistently.

Please review this at http://gwt-code-reviews.appspot.com/102802

Affected files:
   user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java


Index: user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java
===================================================================
--- user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java   (revision  
6813)
+++ user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java   (working copy)
@@ -659,13 +659,17 @@

          /*
           * Emit client-side field information for classes that may be  
enhanced
-         * on the server and which are capable of being transmitted in both
-         * directions. Each line consists of a comma-separated list  
containing
-         * the keyword '@ClientFields', the class name, and a list of all
-         * potentially serializable client-visible fields.
+         * on the server. Each line consists of a comma-separated list
+         * containing the keyword '@ClientFields', the class name, and a  
list of
+         * all potentially serializable client-visible fields.
+         *
+         * We generate the field information even if the class cannot be  
sent in
+         * both directions in order to guarantee that the extra info is  
placed
+         * into the stream consistently.
           */
          if ((type instanceof JClassType)
-            && serializationSto.maybeEnhanced(type) &&  
deserializationSto.maybeEnhanced(type)) {
+            && (serializationSto.maybeEnhanced(type)
+            || deserializationSto.maybeEnhanced(type))) {
            JField[] fields = ((JClassType) type).getFields();
            JField[] rpcFields = new JField[fields.length];
            int numRpcFields = 0;



--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to