Polishing.

Fix backport to use isPresent instead of isEmpty.

See #2264
This commit is contained in:
Mark Paluch
2023-06-15 17:11:27 +02:00
parent 47724b3cba
commit 011aad0d66

View File

@@ -685,9 +685,8 @@ public class DomainObjectReader {
result = mergeCollections(property, sourceValue, targetValue, mapper);
} else if (property.isEntity()) {
result = targetValue.isEmpty()
? sourceValue
: targetValue.flatMap(t -> sourceValue.map(s -> mergeForPut(s, t, mapper)));
result = targetValue.isPresent() ? targetValue.flatMap(t -> sourceValue.map(s -> mergeForPut(s, t, mapper)))
: sourceValue;
} else {
result = sourceValue;
}