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

Commit

Permalink
Fix #48
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jul 8, 2015
1 parent 05118f2 commit 68d85d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Project: jackson-datatype-guava
=== History: ===
------------------------------------------------------------------------

2.4.7 (not released)

#48: Avoid problems deserializing `null` for `Optional`

2.4.6 (23-Apr-2015)

#61: NPE serializing `Multimap`s with null values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public Optional<?> deserialize(JsonParser jp, DeserializationContext ctxt) throw
} else {
refd = _valueDeserializer.deserializeWithType(jp, ctxt, _valueTypeDeserializer);
}
return Optional.of(refd);
return Optional.fromNullable(refd);
}

/* NOTE: usually should not need this method... but for some reason, it is needed here.
Expand All @@ -121,6 +121,6 @@ public Optional<?> deserializeWithType(JsonParser jp, DeserializationContext ctx
return deserialize(jp, ctxt);
}
// with type deserializer to use here? Looks like we get passed same one?
return Optional.of(typeDeserializer.deserializeTypedFromAny(jp, ctxt));
return Optional.fromNullable(typeDeserializer.deserializeTypedFromAny(jp, ctxt));
}
}

0 comments on commit 68d85d5

Please sign in to comment.