mirror of https://github.com/alibaba/fastjson2.git
to #3789, toJavaObject IgnoreSetNullValue
This commit is contained in:
parent
ce0eb76f15
commit
4edd37e519
|
@ -695,7 +695,7 @@ public class ObjectReaderAdapter<T>
|
|||
FieldReader fieldReader = fieldReaders[i];
|
||||
Object fieldValue = map.get(fieldReader.fieldName);
|
||||
if (fieldValue == null) {
|
||||
if ((features & JSONReader.Feature.IgnoreSetNullValue.mask) != 0 || !map.containsKey(fieldReader.fieldName)) {
|
||||
if ((features2 & JSONReader.Feature.IgnoreSetNullValue.mask) != 0 || !map.containsKey(fieldReader.fieldName)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ public class Issue3789 {
|
|||
() -> JSONObject.of("name", null).to(Bean.class));
|
||||
|
||||
assertNull(JSONObject.of("name", null).to(Bean.class, JSONReader.Feature.IgnoreSetNullValue).name);
|
||||
assertNull(JSONObject.of().to(Bean.class).name);
|
||||
|
||||
assertEquals(name,
|
||||
JSONObject.of("name", name).to(Bean.class).name);
|
||||
|
|
Loading…
Reference in New Issue