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.
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 Comparableandjava.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.