Revision: 6323
Author: b...@google.com
Date: Thu Oct  8 10:06:39 2009
Log: Various fixes for deRPC.
- If an array type is artificially rescued, it should rescue its component  
type.
- Don't generate bad RPC proxy code if the legacy type-elision flag is set.
- Correctly handle CustomFieldSerializers that write null Strings.

Patch by: bobv
Review by: jgw (desk)
http://code.google.com/p/google-web-toolkit/source/detail?r=6323

Modified:
  /trunk/dev/core/src/com/google/gwt/dev/javac/ArtificialRescueChecker.java
  /trunk/user/src/com/google/gwt/rpc/rebind/RpcProxyCreator.java
   
/trunk/user/src/com/google/gwt/rpc/server/CommandServerSerializationStreamReader.java

=======================================
---  
/trunk/dev/core/src/com/google/gwt/dev/javac/ArtificialRescueChecker.java       
 
Mon Jul  6 14:45:31 2009
+++  
/trunk/dev/core/src/com/google/gwt/dev/javac/ArtificialRescueChecker.java       
 
Thu Oct  8 10:06:39 2009
@@ -102,6 +102,15 @@
        if (collectTypes) {
          referencedTypes = Lists.add(referencedTypes, className);
        }
+
+      boolean isArray = false;
+      while (className.endsWith("[]")) {
+        className = className.substring(0, className.length() - 2);
+        if (collectTypes) {
+          referencedTypes = Lists.add(referencedTypes, className);
+        }
+        isArray = true;
+      }

        if (!reportErrors) {
          // Nothing else to do
@@ -110,11 +119,6 @@

        // Goal (2)
        // Strip off any array-like extensions and just find base type
-      boolean isArray = false;
-      while (className.endsWith("[]")) {
-        className = className.substring(0, className.length() - 2);
-        isArray = true;
-      }

        // Fix JSNI primitive type names to something JDT will understand
        if (isArray && className.length() == 1) {
=======================================
--- /trunk/user/src/com/google/gwt/rpc/rebind/RpcProxyCreator.java      Tue Jul 
 
21 14:50:34 2009
+++ /trunk/user/src/com/google/gwt/rpc/rebind/RpcProxyCreator.java      Thu Oct 
  
8 10:06:39 2009
@@ -111,6 +111,11 @@
          + ".create() : null;");
      srcWriter.println();
    }
+
+  @Override
+  protected void generateStreamWriterOverride(SourceWriter srcWriter) {
+    // Intentional no-op. Called if elideTypeNames is on, which is ignored
+  }

    @Override
    protected void generateTypeHandlers(TreeLogger logger, GeneratorContext  
ctx,
=======================================
---  
/trunk/user/src/com/google/gwt/rpc/server/CommandServerSerializationStreamReader.java
    
Mon Jul  6 16:17:17 2009
+++  
/trunk/user/src/com/google/gwt/rpc/server/CommandServerSerializationStreamReader.java
    
Thu Oct  8 10:06:39 2009
@@ -314,7 +314,7 @@
    }

    public String readString() throws SerializationException {
-    return readNextCommand(StringValueCommand.class).getValue();
+    return (String) readObject();
    }

    private <T extends ValueCommand> T readNextCommand(Class<T> clazz)

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

Reply via email to