-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed
Description
The Gson
class has logic for handling null
arguments for getAdapter(TypeToken)
, see:
TypeAdapter<?> cached = typeTokenCache.get(type == null ? NULL_KEY_SURROGATE : type); |
However, it appears the pull request which tried to keep the support for null
arguments also broke it due to commit 31dcfa3 because it does not reassign a non-null
value to the type
argument anymore which later on in the method causes a NullPointerException
.
However that was 4 years ago and it appears support for null
arguments might not have been used much (if at all; I did not find existing issues about this here on GitHub). Therefore maybe it would be better instead of fixing this issue to simply remove null
handling for getAdapter(TypeToken)
completely and to throw an exception on purpose.
Metadata
Metadata
Assignees
Labels
No labels