Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public Object getAbsentValue(DeserializationContext ctxt) {
/**********************************************************************
*/

/**
/**
* Method called to determine value to be used for "empty" values
* (most commonly when deserializing from empty JSON Strings).
* Usually this is same as {@link #getNullValue} (which in turn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,12 @@ public AtomicReferenceDeserializer withResolved(TypeDeserializer typeDeser, Valu
@Override
public AtomicReference<Object> getNullValue(DeserializationContext ctxt) {
// 07-May-2019, tatu: [databind#2303], needed for nested ReferenceTypes
return new AtomicReference<Object>(_valueDeserializer.getNullValue(ctxt));
}

@Override
public Object getEmptyValue(DeserializationContext ctxt) {
// 07-May-2019, tatu: I _think_ this needs to align with "null value" and
// not necessarily with empty value of contents? (used to just do "absent"
// so either way this seems to me like an improvement)
return getNullValue(ctxt);
}

/**
* Let's actually NOT coerce missing Creator parameters into empty value.
*/
@Override
public Object getAbsentValue(DeserializationContext ctxt) {
return null;
return new AtomicReference<>(_valueDeserializer.getNullValue(ctxt));
}

@Override
public AtomicReference<Object> referenceValue(Object contents) {
return new AtomicReference<Object>(contents);
return new AtomicReference<>(contents);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,13 @@ public Object getEmptyValue(DeserializationContext ctxt) {

// 02-Sep-2021, tatu: Related to [databind#3214] we may want to add this... but
// with 2.13.0 so close will not yet do that, but wait for 2.14
// @Override
// public Object getAbsentValue(DeserializationContext ctxt) {
// return null;
// }
// 13-Oct-2025, tatu: Time to do it for 3.0.1 (ought to have done for 3.0.0 but missed it)
@Override
public Object getAbsentValue(DeserializationContext ctxt) {
// 21-Sep-2022, tatu: [databind#3601] Let's make absent become `null`,
// NOT "null value" (Empty)
return null;
}

public abstract T referenceValue(Object contents);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,6 @@ public Optional<?> getNullValue(DeserializationContext ctxt) {
return Optional.ofNullable(_valueDeserializer.getNullValue(ctxt));
}

@Override
public Object getEmptyValue(DeserializationContext ctxt) {
// 07-May-2019, tatu: I _think_ this needs to align with "null value" and
// not necessarily with empty value of contents? (used to just do "absent"
// so either way this seems to me like an improvement)
return getNullValue(ctxt);
}

/**
* Let's actually NOT coerce missing Creator parameters into empty value.
*/
@Override
public Object getAbsentValue(DeserializationContext ctxt) {
// 21-Sep-2022, tatu: [databind#3601] Let's make absent become `null`,
// NOT "null value" (Empty)
return null;
}

@Override
public Optional<?> referenceValue(Object contents) {
return Optional.ofNullable(contents);
Expand Down