Skip to content

Commit

Permalink
Minor improvement to handling of JsonFormat.Value with AnnotationIntr…
Browse files Browse the repository at this point in the history
…ospectorPair, should try merging
  • Loading branch information
cowtowncoder committed Nov 28, 2015
1 parent 3c35f1c commit 7e5f014
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Expand Up @@ -404,11 +404,15 @@ public ObjectIdInfo findObjectReferenceInfo(Annotated ann, ObjectIdInfo objectId
objectIdInfo = _primary.findObjectReferenceInfo(ann, objectIdInfo);
return objectIdInfo;
}

@Override
public JsonFormat.Value findFormat(Annotated ann) {
JsonFormat.Value r = _primary.findFormat(ann);
return (r == null) ? _secondary.findFormat(ann) : r;
JsonFormat.Value v1 = _primary.findFormat(ann);
JsonFormat.Value v2 = _secondary.findFormat(ann);
if (v2 == null) { // shouldn't occur but just in case
return v1;
}
return v2.withOverrides(v1);
}

@Override
Expand Down
Expand Up @@ -99,10 +99,11 @@ public void testPolymorphicWithOverride() throws Exception
list.add("value 2");

String serialized = MAPPER.writeValueAsString(list);
System.out.println(serialized);
// System.out.println(serialized);

StringyList<String> deserialized = MAPPER.readValue(serialized, type);
System.out.println(deserialized);
// System.out.println(deserialized);

assertNotNull(deserialized);
}
}

0 comments on commit 7e5f014

Please sign in to comment.