GSON 1.x applies different rules for versioning for classes vs fields. So, if you deserialize a
JSON into a field that is supposed to be skipped, the field is set to null (or default value).
However, if you deserialize it to a top-level class, a default instance is returned.
GSON 2.x returns null for the top-level class.
Previously we would set the field if the created instance is being assigned to a field of another object. We wouldn't set it when the created instance is a collection element or the top-level object.
Created a new class for character/char tests, PrimitiveCharacterTest. This is the start of breaking down PrimitiveTest into smaller chunks.
When MiniGson can not find a type adapter for a type, revised the message to say can't handle instead of can't serialize.
Got rid of default Hierarchy Serializer/Deserializers from DefaultTypeAdapters.
Got rid of methods for gettting default serializers/deserializers/instance creators. Instead we reuse the static final instances.
Fixed warnings in TypeAdapters where a parameterized type T was hiding the parameterized T in methods.
Removed support to unwrap single element array of enums into enum values. Also removed the test that verifies this behavior.
Consolidated all of the different code paths that we use to construct instances. We now have an ObjectConstructor class that knows what type it constructs; this means that we don't need to ever do reflection to lookup a constructor at construction time.
Cleaned up some buggy type adapters, particularly around handling of null.
Removed dead code for object graph navigation.
Moved some classes into 'internal' so they are visible to the 'bind' subpackage.
Turned some TypeAdapterFactory/TypeAdapter pairs inside out so that the TypeAdapter is now the inner class. This is necessary so that the factories can take parameters.
Added an API to request the 'next' type adapter for a type. This allows type adapters to compose other type adapters. We're using this in two places:
- where the user has excluded a type from serialization but not deserialization, we need to use the "default" deserialization but interpose null on serialization. We create a type adapter that delegates for one and returns null for the other.
- similarly when a DOM type serializer is registered but no deserializer, or vice versa.
This is the biggest change to the MiniGson core.
For backwards compatibility, return null for the empty string.
Simplify JsonSerializationContext/JsonDeserializationContext to simply call through to GSON. SerializeDefault is currently unsupported.
More useful error messages when calling getAsBoolean on a JsonNull.
Remove currently unused MemoryRefStack. We might need this back again, though wiring it back in will be much more difficult because we don't interject ourselves between the users' various type adapters.