Skip to content

Commit 4547eaf

Browse files
committed
Minor simplification to type handling. Note: does require latest 2.7.0-snapshot of databind to pass
1 parent fbc723b commit 4547eaf

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/com/fasterxml/jackson/datatype/jdk8/Jdk8Deserializers.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ public JsonDeserializer<?> findBeanDeserializer(JavaType type, DeserializationCo
2222
{
2323
final Class<?> raw = type.getRawClass();
2424
if (raw == Optional.class) {
25-
JavaType[] types = config.getTypeFactory().findTypeParameters(type, Optional.class);
26-
JavaType refType = (types == null) ? TypeFactory.unknownType() : types[0];
25+
JavaType refType = type.getReferencedType();
26+
27+
// 10-Oct-2015, tatu: Really should not occur. But... let's be paranoid
28+
if (refType == null) {
29+
// error or placeholder? Placeholder for now:
30+
refType = TypeFactory.unknownType();
31+
}
2732
JsonDeserializer<?> valueDeser = type.getValueHandler();
2833
TypeDeserializer typeDeser = type.getTypeHandler();
2934
// [jackson-datatype-guava:Issue#42]: Polymorphic types need type deserializer

0 commit comments

Comments
 (0)