On Friday, August 06, 2010 00:48:34 codesite-nore...@google.com wrote:
> Revision: 8484
> Author: cromwell...@google.com
> Date: Wed Aug  4 22:08:44 2010
> Log: Fix support for null fields and Boolean type types in RequestFactory.
> Null fix patch by icsy
> 
> Review at http://gwt-code-reviews.appspot.com/739801
> 
> Review by: amitman...@google.com
> http://code.google.com/p/google-web-toolkit/source/detail?r=8484
> 
> Added:
> [...]

This patch is currently not working at all.

> [...]
> /trunk/user/src/com/google/gwt/valuestore/shared/impl/RecordJsoImpl.java
> Wed Aug  4 22:08:44 2010
> @@ -83,45 +83,55 @@
>       // assert isDefined(property.getName()) :
>       // "Cannot ask for a property before setting it: "
>       // + property.getName();
> [...]
> +    if (isNull(property.getName())) {
> +      return null;
> +    }

Not a bad idea to check for null, but this currently doesn't work. It
seems that null object (let say a Long) are transmitted using the string
'null'. The current check is looking for a null value instead.

> +    try {
> +      if (Boolean.class.equals(property.getType())) {
> +      return (V) Boolean.valueOf((String) get(property.getName()));
> +      }

This cannot be done anymore. You changed the type of boolean in the
request so it would be transmitted as a native js boolean. Now that line
needs to be:
return (V) Boolean.valueOf(getBoolean(property.getName()));

with this getBoolean defined as:
private native boolean getBoolean(String name) /*-{
  return this[name];
}-*/;

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

Reply via email to