sefasdfasd / google-gson

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

GsonBuilder.disableUnsafe #445

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
While it is nice to know that Unsafe is only used when no-arg ctors or instance 
creators are not present, it would be better to have a means to enforce it 
cannot be used.  Particularly in google app engine, I'd like to know that the 
code I use offline is safe inside GAE, rather than a delayed 
UnsupportedOperationException

Can you add GsonBuilder.disableUnsafe or similar?

Original issue reported on code.google.com by adrian.f...@gmail.com on 16 May 2012 at 5:58

GoogleCodeExporter commented 9 years ago
I think this is a good idea. I personally don't like the unpredictability that 
UnsafeAllocator brings either.

Original comment by inder123 on 30 May 2012 at 4:17