Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

Commit

Permalink
One last (?) fix to schema access for GuavaOptionalSerializer
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Sep 22, 2014
1 parent 959aa0f commit 7b5c7b7
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,16 @@ public void serializeWithType(Optional<?> value,
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException
{
JavaType typeParameter = typeHint.containedType(0);
if (typeParameter != null) {
JsonSerializer<?> ser = visitor.getProvider().findValueSerializer(typeParameter, null);
ser.acceptJsonFormatVisitor(visitor, typeParameter);
return;
JavaType valueType = _valueType();
if (valueType != null) {
JsonSerializer<?> ser = _valueSerializer;
if (ser == null) {
ser = visitor.getProvider().findValueSerializer(valueType, null);
}
ser.acceptJsonFormatVisitor(visitor, valueType);
} else {
super.acceptJsonFormatVisitor(visitor, typeHint);
}
super.acceptJsonFormatVisitor(visitor, typeHint);
}

protected JavaType _valueType() {
Expand Down

0 comments on commit 7b5c7b7

Please sign in to comment.