-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Open
Labels
Description
When trying to deserialize the values [[{},null],false,false]
and [[null,false],null,true]
with the code (new Gson()).fromJson(x, Map.class);
two confusing exceptions are thrown:
java.lang.ClassCastException: com.google.gson.internal.LinkedTreeMap is not Comparable
and
java.lang.NullPointerException: key == null
, respectively.
Such exceptions should not be thrown to the user. Instead, one would expect these cases to be reported with an IllegalArgumentException
.
gabin8