Skip to content
Snippets Groups Projects
Commit b8d39e0d authored by pkupczyk's avatar pkupczyk
Browse files

SP-111 / BIS-49: JSON-RPC - properly handle circular dependencies

SVN: 25761
parent b8356e3d
No related branches found
No related tags found
No related merge requests found
......@@ -80,6 +80,20 @@ public class JsonTypeAndClassDeserializer extends AsPropertyTypeDeserializer
return new JsonTypeAndClassDeserializer(this, prop);
}
@Override
public Object deserializeTypedFromAny(JsonParser jp, DeserializationContext ctxt)
throws IOException, JsonProcessingException
{
return deserializeTypedFromObject(jp, ctxt);
}
@Override
public Object deserializeTypedFromArray(JsonParser jp, DeserializationContext ctxt)
throws IOException, JsonProcessingException
{
return deserializeTypedFromObject(jp, ctxt);
}
@Override
public Object deserializeTypedFromObject(JsonParser jp, DeserializationContext ctxt)
throws IOException, JsonProcessingException
......@@ -211,9 +225,20 @@ public class JsonTypeAndClassDeserializer extends AsPropertyTypeDeserializer
public Object deserializeWithoutType(JsonParser jp, DeserializationContext ctxt, TokenBuffer tb)
throws IOException, JsonProcessingException
{
JsonToken t = jp.getCurrentToken();
final JsonParser actualJp;
final JsonDeserializer<Object> deserializer =
ctxt.findContextualValueDeserializer(_baseType, _property);
final JsonDeserializer<Object> deserializer;
if (t == JsonToken.START_ARRAY && _baseType.getRawClass().equals(Object.class))
{
JavaType collectionType =
ctxt.getConfig().getTypeFactory().constructRawCollectionType(Collection.class);
deserializer = ctxt.findContextualValueDeserializer(collectionType, _property);
} else
{
deserializer = ctxt.findContextualValueDeserializer(_baseType, _property);
}
if (tb != null)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment