When a null is encountered in deserialization, don't use a JSONObject Null as it cannot be cast to a Java integer/float/... but rather store a Java null which can be cast to an appropriate Java type.