2011-09-09 06:20:25 +02:00
|
|
|
What's new in GSON 2.0
|
|
|
|
|
|
|
|
GSON 1.x used to automatically unwrap single-element arrays as necessary.
|
|
|
|
GSON 2.x doesn't.
|
|
|
|
com.google.gson.functional.ArrayTest.testSingleStringArrayDeserialization
|
2011-09-09 07:04:24 +02:00
|
|
|
com.google.gson.functional.PrimitiveTest#testPrimitiveIntegerAutoboxedInASingleElementArrayDeserialization
|
|
|
|
com.google.gson.functional.PrimitiveTest#testPrimitiveLongAutoboxedInASingleElementArrayDeserialization
|
|
|
|
com.google.gson.functional.PrimitiveTest#testPrimitiveBooleanAutoboxedDeserialization
|
|
|
|
com.google.gson.functional.PrimitiveTest.testPrimitiveBooleanAutoboxedInASingleElementArrayDeserialization
|
|
|
|
com.google.gson.functional.PrimitiveTest.testPrimitiveDoubleAutoboxedInASingleElementArrayDeserialization
|
|
|
|
com.google.gson.functional.PrimitiveTest.testBigDecimalInASingleElementArrayDeserialization
|
|
|
|
com.google.gson.functional.PrimitiveTest.testBigIntegerInASingleElementArrayDeserialization
|
2011-09-09 07:41:35 +02:00
|
|
|
com.google.gson.functional.StringTest.testStringValueAsSingleElementArrayDeserialization
|
2011-09-16 07:40:05 +02:00
|
|
|
com.google.gson.functional.EnumTest.testTopLevelEnumInASingleElementArrayDeserialization
|
2011-09-09 06:20:25 +02:00
|
|
|
|
|
|
|
GSON 1.x permitted primitive types to be overridden
|
|
|
|
GSON 2.x doesn't.
|
2011-09-09 07:04:24 +02:00
|
|
|
com.google.gson.functional.ArrayTest.testArrayOfPrimitivesWithCustomTypeAdapter
|
|
|
|
com.google.gson.functional.PrimitiveTest.testOverridingDefaultPrimitiveSerialization
|
|
|
|
|
|
|
|
|
|
|
|
GSON 1.x rejects integers that have any fraction, even if it is ".0"
|
|
|
|
GSON 2.x permits integers to have ".0" fractions like "1.0"
|
2011-09-09 07:11:59 +02:00
|
|
|
com.google.gson.functional.PrimitiveTest.testDeserializingDecimalPointValuesAsIntegerFails
|
|
|
|
|
|
|
|
GSON 1.x truncates oversized large integers and longs
|
|
|
|
GSON 2.x fails on oversized large integers and longs
|
|
|
|
com.google.gson.functional.PrimitiveTest.testDeserializingBigIntegerAsInteger
|
2011-09-09 07:23:01 +02:00
|
|
|
com.google.gson.functional.PrimitiveTest.testDeserializingBigIntegerAsLong
|
|
|
|
|
|
|
|
|
|
|
|
GSON 1.x uses arbitrary precision for primitive type conversion (so -122.08e-2132 != 0)
|
|
|
|
GSON 2.x uses double precision (so -122.08e-2132 == 0)
|
2011-09-09 08:26:21 +02:00
|
|
|
com.google.gson.functional.PrimitiveTest.testDeserializingBigDecimalAsLongFails
|
|
|
|
|
|
|
|
|
|
|
|
GSON 1.x supports type adapters for primitive types
|
|
|
|
GSON 2.x doesn't
|
|
|
|
com.google.gson.functional.CustomTypeAdaptersTest.testCustomSerializerForLong
|
|
|
|
com.google.gson.functional.CustomTypeAdaptersTest.testCustomDeserializerForLong
|
2011-09-28 21:38:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
GSON 1.x throws IllegalStateException on circular references
|
|
|
|
GSON 2.x lets the runtime throw a StackOverflowError
|
|
|
|
com.google.gson.functional.CircularReferenceTest.testCircularSerialization
|
|
|
|
com.google.gson.functional.CircularReferenceTest.testSelfReferenceSerialization
|
|
|
|
com.google.gson.functional.CircularReferenceTest.testSelfReferenceArrayFieldSerialization
|
2011-09-29 18:38:24 +02:00
|
|
|
com.google.gson.functional.CircularReferenceTest.testSelfReferenceCustomHandlerSerialization
|
|
|
|
|
|
|
|
|
|
|
|
GSON 1.x sometimes sets subclass fields when an InstanceCreator returns a subclass.
|
|
|
|
This occurs only when the value is a field of another object: not when its
|
|
|
|
the top level object or a collection element.
|
|
|
|
GSON 2.x sets fields of the requested type only
|
|
|
|
com.google.gson.functional.InstanceCreatorTest.testInstanceCreatorReturnsSubTypeForField
|
2011-09-30 00:15:37 +02:00
|
|
|
|
2011-09-30 09:08:44 +02:00
|
|
|
|
2011-09-30 00:15:37 +02:00
|
|
|
GSON 1.x applies different rules for versioning for classes vs fields. So, if you deserialize a
|
2011-09-30 09:08:44 +02:00
|
|
|
JSON into a field that is supposed to be skipped, the field is set to null (or default value).
|
2011-09-30 00:15:37 +02:00
|
|
|
However, if you deserialize it to a top-level class, a default instance is returned.
|
2011-09-30 09:08:44 +02:00
|
|
|
GSON 2.x returns null for the top-level class.
|
|
|
|
com.google.gson.functional.VersioningTest.testIgnoreLaterVersionClassDeserialization
|
|
|
|
|
|
|
|
|
|
|
|
GSON 1.x creates the empty string "" if the only element is skipped
|
|
|
|
GSON 2.x writes "null" if the only element is skipped
|
|
|
|
com.google.gson.functional.ObjectTest.testAnonymousLocalClassesSerialization
|
|
|
|
com.google.gson.functional.FieldExclusionTest.testInnerClassExclusion
|
|
|
|
com.google.gson.functional.VersioningTest.testIgnoreLaterVersionClassSerialization
|