liangcm / cloud-tasks-io

Automatically exported from code.google.com/p/cloud-tasks-io
0 stars 0 forks source link

RequestFactory cannot send Boolean.TRUE to Android client #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create RequestFactory Service
2. Create an Android client
3. Create a method that returns Boolean

What is the expected output? What do you see instead?
When called on the android side you would expect to see "true". Instead I get a 
ClassCastException. If I have the server return Boolean.FALSE without updating 
the Android client at all it gets "false" as expected. I found this with a more 
complicated method, but something as simple as the method below fails.

public static Boolean getTrue() {
  return Boolean.TRUE; //ERRORS ON Android client.
// android receives JSON of :{"S":[true],"I":[true]}
}

public static Boolean getFalse() {
  return Boolean.FALSE; //Works on Android client
// android receives JSON of :{"S":[true],"I":[false]}
}

What version of the product are you using? On what operating system?
I am using the jars from this package on both the client and server side. 
Strings return as expected, so communication is certainly working.

Please provide any additional information below.
Android exception:
05-16 16:32:07.493: WARN/System.err(23252): java.lang.ClassCastException: 
java.lang.Boolean
05-16 16:32:07.513: WARN/System.err(23252):     at 
com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$Standar
dPayloadDialect.processPayload(AbstractRequestContext.java:326)
05-16 16:32:07.513: WARN/System.err(23252):     at 
com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$4.onTra
nsportSuccess(AbstractRequestContext.java:1021)
05-16 16:32:07.535: WARN/System.err(23252):     at 
com.dualsportmaps.android.DSMTest.send(DSMTest.java:60)

Original issue reported on code.google.com by ad...@dualsportmaps.com on 16 May 2011 at 4:53