commit | f2c40cb08b734d78aa37ef75c17d83da3b443c26 | [log] [tgz] |
---|---|---|
author | Tatu Saloranta <tatu.saloranta@iki.fi> | Tue May 10 20:21:32 2016 -0700 |
committer | Tatu Saloranta <tatu.saloranta@iki.fi> | Tue May 10 20:21:32 2016 -0700 |
tree | aad7ec074bbc99845b59798284ae9220f43dc7bf | |
parent | 33ba4ad08ee2220b62028101b026e29ed4167d52 [diff] |
Add a test for handling of "unknown type id"
diff --git a/src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java b/src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java index ec6bbc0..fd69008 100644 --- a/src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java +++ b/src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java
@@ -889,7 +889,12 @@ if (type.hasRawClass(Void.class)) { return null; } - return type; + // But ensure there's type compatibility + if (type.isTypeOrSubTypeOf(baseType.getRawClass())) { + return type; + } + throw unknownTypeException(baseType, id, + "problem handler tried to resolve into non-subtype: "+type); } h = h.next(); }