Skip to content

Commit 5644892

Browse files
committed
Merge branch '2.19'
2 parents 916cc53 + 17858e9 commit 5644892

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/tools/jackson/databind/deser/bean/BeanDeserializer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,6 @@ public Object deserializeFromObject(JsonParser p, DeserializationContext ctxt) t
498498
return bean;
499499
}
500500
final Object bean = _valueInstantiator.createUsingDefault(ctxt);
501-
// [databind#631]: Assign current value, to be accessible by custom deserializers
502-
p.assignCurrentValue(bean);
503501

504502
// First: do we have native Object Ids (like YAML)?
505503
if (p.canReadObjectId()) {
@@ -524,6 +522,9 @@ else if (_objectIdReader != null && p.hasTokenId(JsonTokenId.ID_END_OBJECT)) {
524522
// should we check what exactly it is... ?
525523
return bean;
526524
}
525+
// [databind#631]: Assign current value, to be accessible by custom serializers
526+
// [databind#4184]: but only if we have at least one property
527+
p.assignCurrentValue(bean);
527528
if (_needViewProcesing) {
528529
Class<?> view = ctxt.getActiveView();
529530
if (view != null) {

0 commit comments

Comments
 (0)