Author: [email protected]
Date: Thu Mar 19 16:19:41 2009
New Revision: 5057

Modified:
    trunk/user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java

Log:
Re-enable the gwt.typecreator.shard.size system property to fix RPC  
serializer code in legacy hosted mode.

Patch by: bobv
Review by: jat


Modified:  
trunk/user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java
==============================================================================
---  
trunk/user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java        
 
(original)
+++  
trunk/user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java        
 
Thu Mar 19 16:19:41 2009
@@ -375,7 +375,18 @@
        }
      }

+    boolean shard = shardSize > 0 && filteredTypes.size() > shardSize;
+    int shardCount = 0;
+
+    if (shard) {
+      srcWriter.println("(function() {");
+    }
+
      for (JType type : filteredTypes) {
+      if (shard && ++shardCount % shardSize == 0) {
+        srcWriter.println("})();");
+        srcWriter.println("(function() {");
+      }

         
srcWriter.println("@com.google.gwt.user.client.rpc.impl.SerializerBase"
            + "::registerMethods("
@@ -397,6 +408,10 @@
        srcWriter.println();
      }

+    if (shard) {
+      srcWriter.println("})();");
+    }
+
      srcWriter.outdent();
      srcWriter.println("}-*/;");
      srcWriter.println();
@@ -407,6 +422,12 @@
      srcWriter.indent();

      int index = 0;
+    boolean shard = shardSize > 0 && getSerializableTypes().length >  
shardSize;
+    int shardCount = 0;
+
+    if (shard) {
+      srcWriter.println("(function() {");
+    }

      for (JType type : getSerializableTypes()) {

@@ -429,6 +450,12 @@
          jsniTypeRef += "[]";
          type = type.isArray().getComponentType();
        }
+
+      if (shard && ++shardCount % shardSize == 0) {
+        srcWriter.println("})();");
+        srcWriter.println("(function() {");
+      }
+
         
srcWriter.println("@com.google.gwt.user.client.rpc.impl.SerializerBase"
            + "::registerSignature("
            + "Lcom/google/gwt/core/client/JsArrayString;"  
+ "Ljava/lang/Class;"
@@ -439,6 +466,10 @@
        srcWriter.println("\"" + typeString + "\");");
        srcWriter.outdent();
        srcWriter.println();
+    }
+
+    if (shard) {
+      srcWriter.println("})();");
      }

      srcWriter.outdent();

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

Reply via email to