Revision: 8077
Author: [email protected]
Date: Mon May 10 13:04:43 2010
Log: Doubles can now be sent over the wire.

Patch by: amitmanjhi
Review by: rjrjr (desk review)

Review at http://gwt-code-reviews.appspot.com/503801

http://code.google.com/p/google-web-toolkit/source/detail?r=8077

Modified:
/branches/2.1/bikeshed/src/com/google/gwt/requestfactory/server/RequestFactoryServlet.java /branches/2.1/bikeshed/src/com/google/gwt/valuestore/shared/impl/RecordJsoImpl.java
 /branches/2.1/bikeshed/war/WEB-INF/appengine-web.xml

=======================================
--- /branches/2.1/bikeshed/src/com/google/gwt/requestfactory/server/RequestFactoryServlet.java Fri May 7 15:22:39 2010 +++ /branches/2.1/bikeshed/src/com/google/gwt/requestfactory/server/RequestFactoryServlet.java Mon May 10 13:04:43 2010
@@ -542,6 +542,17 @@
     if (idValue.getClass() == String.class && idType == Long.class) {
       return new Long((String) idValue);
     }
+    if (idType == Double.class) {
+      if (idValue.getClass() == Integer.class) {
+        return new Double((Integer) idValue);
+      }
+      if (idValue.getClass() == Long.class) {
+        return new Double((Long) idValue);
+      }
+      if (idValue.getClass() == Float.class) {
+        return new Double((Float) idValue);
+      }
+    }
throw new IllegalArgumentException("id is of type: " + idValue.getClass()
         + ",  expected type: " + idType);
   }
=======================================
--- /branches/2.1/bikeshed/src/com/google/gwt/valuestore/shared/impl/RecordJsoImpl.java Fri May 7 15:22:39 2010 +++ /branches/2.1/bikeshed/src/com/google/gwt/valuestore/shared/impl/RecordJsoImpl.java Mon May 10 13:04:43 2010
@@ -77,6 +77,9 @@
       return (V) Integer.valueOf(getInt(property.getName()));
     }
     if (Double.class.equals(property.getType())) {
+      if (!isDefined(property.getName())) {
+        return (V) new Double(0.0);
+      }
       return (V) Double.valueOf(getDouble(property.getName()));
     }
     if (Date.class.equals(property.getType())) {
@@ -160,6 +163,10 @@
       setDouble(property.getName(), millis);
       return;
     }
+    if (value instanceof Double) {
+      setDouble(property.getName(), (Double) value);
+      return;
+    }
throw new UnsupportedOperationException("Can't yet set properties of type "
         + value.getClass().getName());
   }
=======================================
--- /branches/2.1/bikeshed/war/WEB-INF/appengine-web.xml Thu May 6 19:50:57 2010 +++ /branches/2.1/bikeshed/war/WEB-INF/appengine-web.xml Mon May 10 13:04:43 2010
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <appengine-web-app xmlns="http://appengine.google.com/ns/1.0";>
        <application>gwt-bikeshed</application>
-       <version>3</version>
+       <version>4</version>

        <!-- Configure java.util.logging -->
        <system-properties>

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

Reply via email to