DonaldDu / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

Cannot override default adapter for BigInteger type #413

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've tried 
registerTypeAdapter(BigInteger.class, new TypeAdapter<BigInteger>()...)
but with no success.

The default behavior is not correct for javascript.

I see solution for Long (setLongSerializationPolicy method).
But with BigInteger I gave up and changed the library.

Original issue reported on code.google.com by man...@barco.kiev.ua on 21 Feb 2012 at 2:49

GoogleCodeExporter commented 9 years ago
Yeah, that's definitely a bug. I'm tempted to just make the long serialization 
policy apply to BigIntegers and BigDecimals. But I know that there's some 
danger there.

Our best solution will be to make the type adapters for BigInteger and 
BigDecimal user-overrideable in Gson 2.2.

Original comment by limpbizkit on 25 Feb 2012 at 4:09

GoogleCodeExporter commented 9 years ago
Thanks for reporting this. Fixed with r1132.

Original comment by limpbizkit on 18 Mar 2012 at 5:56