Skip to content

Commit 37527d9

Browse files
committed
Minor messaging improvement
1 parent 37056cb commit 37527d9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/tools/jackson/databind/deser/BeanDeserializerFactory.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ public ValueDeserializer<Object> buildBeanDeserializer(DeserializationContext ct
274274
addObjectIdReader(ctxt, beanDescRef, builder);
275275

276276
// managed/back reference fields/setters need special handling... first part
277-
// [databind#2686]: targetType For Builder pattern, this method is not using.
278-
// So this value is null.
277+
// [databind#2686]: Pass null for non-Builder deserialization (only Builder-based
278+
// deserialization needs the target type for back-reference resolution)
279279
addBackReferenceProperties(ctxt, beanDescRef, builder, null);
280280
addInjectables(ctxt, beanDescRef, builder);
281281

@@ -785,8 +785,8 @@ protected void addBackReferenceProperties(DeserializationContext ctxt,
785785
} else {
786786
if (targetType != null) {
787787
ctxt.reportBadTypeDefinition(beanDescRef,
788-
"Cannot find back-reference field '%s' in target type '%s' for Builder-based deserialization",
789-
refProp.getName(), targetType.getRawClass().getName());
788+
"Cannot find back-reference field '%s' in target type %s for Builder-based deserialization: ensure the field exists in the target class, not just the Builder",
789+
refProp.getName(), ClassUtil.nameOf(targetType.getRawClass()));
790790
} else {
791791
ctxt.reportBadTypeDefinition(beanDescRef,
792792
"Cannot resolve back-reference property '%s'",

0 commit comments

Comments
 (0)