I'm using BlazeDS to marshall Java objects to Flex. What I'm seeing is that if a Java Float
holds a integer value (whole number, such as 123), then it gets marshalled to a ActionScript int
. I would expect that a Java Float
always gets marshalled to an ActionScript Number
as documented in the BlazeDS Developer Guide.
Is there a way to configure this or is this just a BlazeDS bug?
Follow-up: The float is contained within a map. The Java map that is being passed to BlazeDS looks something like:
Map map = new HashMap();
Float f = 123.0;
map.put("number", f);
When it arrives on the Flex side map
is an Object
:
var map:Object = ...
trace(map.number);
trace(getQualifiedClassName(map.number));
prints:
123
int
So it's serializing the value correctly, just as the wrong type.