Skip to content

Commit

Permalink
Minor fix to "current value" setting wrt view processing
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 16, 2025
1 parent dcab137 commit 17858e9
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,6 @@ public Object deserializeFromObject(JsonParser p, DeserializationContext ctxt) t
return bean;
}
final Object bean = _valueInstantiator.createUsingDefault(ctxt);
// [databind#631]: Assign current value, to be accessible by custom deserializers
p.assignCurrentValue(bean);

// First: do we have native Object Ids (like YAML)?
if (p.canReadObjectId()) {
Expand Down Expand Up @@ -390,6 +388,9 @@ else if (_objectIdReader != null && p.hasTokenId(JsonTokenId.ID_END_OBJECT)) {
}
}
if (p.hasTokenId(JsonTokenId.ID_FIELD_NAME)) {
// [databind#631]: Assign current value, to be accessible by custom serializers
// [databind#4184]: but only if we have at least one property
p.assignCurrentValue(bean);
String propName = p.currentName();
do {
p.nextToken();
Expand Down Expand Up @@ -680,6 +681,9 @@ protected final Object deserializeWithView(JsonParser p, DeserializationContext
throws IOException
{
if (p.hasTokenId(JsonTokenId.ID_FIELD_NAME)) {
// [databind#631]: Assign current value, to be accessible by custom serializers
// [databind#4184]: but only if we have at least one property
p.assignCurrentValue(bean);
String propName = p.currentName();
do {
p.nextToken();
Expand Down

0 comments on commit 17858e9

Please sign in to comment.