Jar version : json-20251224.jar
Reproduction :
// String constructor — null preserved
new JSONObject("{\"name\":null}"); // {"name":null}
// Map constructor — null dropped
Map<Object, Object> map = new HashMap<>();
map.put("name", null);
new JSONObject(map); // {}
// put() — null dropped
JSONObject json = new JSONObject();
json.put("name", (String) null); // {}
Expected :
All construction paths should treat null consistently. Per the JSON spec (RFC 8259), null is a valid value and should be retained.
Jar version : json-20251224.jar
Reproduction :
Expected :
All construction paths should treat null consistently. Per the JSON spec (RFC 8259), null is a valid value and should be retained.