Skip to content
This repository was archived by the owner on Jun 26, 2021. It is now read-only.

Commit 5d83c8d

Browse files
committed
Make sure the context is properly set.
1 parent 2209aa3 commit 5d83c8d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

emfjson-jackson/src/main/java/org/emfjson/jackson/databind/deser/EObjectDeserializer.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ public boolean isCachable() {
5454

5555
@Override
5656
public EObject deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
57+
prepareContext(ctxt, null);
58+
5759
return doDeserialize(jp, findRoot(ctxt), ctxt);
5860
}
5961

@@ -286,6 +288,11 @@ public Class<?> handledType() {
286288

287289
@Override
288290
public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property) throws JsonMappingException {
291+
prepareContext(ctxt, property);
292+
return this;
293+
}
294+
295+
protected void prepareContext(DeserializationContext ctxt, BeanProperty property) {
289296
ReferenceEntries entries = (ReferenceEntries) ctxt.getAttribute("entries");
290297
Resource resource = (Resource) ctxt.getAttribute("resource");
291298

@@ -309,8 +316,6 @@ public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanPro
309316
ctxt.setAttribute("cache", cache);
310317
ctxt.setAttribute("resourceSet", resourceSet);
311318
ctxt.setAttribute("options", options);
312-
313-
return this;
314319
}
315320

316321
}

0 commit comments

Comments
 (0)