Closed GoogleCodeExporter closed 9 years ago
We have methods like that (though marked private) registerSerializer,
registerDeserializer, etc.
It seems type-safe but with a false sense of security. Unfortunately, Java Type
class is not parameterized, so it is possible for you to attach a
TypeAdapter<T> with any type instead of the type of T. We can address that by
providing registerSerializer(Class<T>, JsonSerializer<T>) but that excludes the
possibility of registering type adapters for parameterized types. Providing
both methods results in unnecessary API bloat.
I think what we currently have is a reasonable solution but if you can think of
a minimalist enhancement that improves type safety, let us know.
Original comment by inder123
on 19 Jan 2011 at 10:16
Original issue reported on code.google.com by
dmitry.s...@gmail.com
on 13 Jan 2011 at 4:56