Closed GoogleCodeExporter closed 9 years ago
Does this work for you?
Gson gson = new GsonBuilder().serializeSpecialFloatingPointValues().build();
This will serialize NaN and Infinity, but not as strings.
Original comment by limpbizkit
on 19 Nov 2011 at 3:33
Yes, it works but I prefer the previous strings.
Original comment by ajk...@gmail.com
on 20 Nov 2011 at 9:39
I'm sorry we broke this use case with the 2.0 upgrade.
We can't support custom type adapters here in the general case without
sacrificing some performance on binding. We're hoping to do optimizations where
we can avoid boxing primitives but that only works when applications don't
provide custom type adapters for primitive types.
I'm keeping this open because with some significant effort we could probably
get Gson to handle custom type adapters as long as it knows to test for them.
Original comment by limpbizkit
on 16 Dec 2011 at 5:01
Fixed in 2.3 by restoring the ability to register custom serializers for
primitive types.
Original comment by limpbizkit
on 1 Jul 2012 at 5:59
Original issue reported on code.google.com by
ajk...@gmail.com
on 18 Nov 2011 at 12:09