Skip to content

Commit 1a59180

Browse files
committed
Fix #2846
1 parent 9a38c23 commit 1a59180

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

release-notes/VERSION-2.x

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Project: jackson-databind
1313
#2840: `ObjectMapper.activateDefaultTypingAsProperty()` is not using
1414
parameter `PolymorphicTypeValidator`
1515
(reported by Daniel W)
16+
#2846: Problem deserialization "raw generic" fields (like `Map`) in 2.11.2
1617
- Fix issues with `MapLikeType.isTrueMapType()`,
1718
`CollectionLikeType.isTrueCollectionType()`
1819

src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedClass.java

+6
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@ public static AnnotatedClass constructWithoutSuperTypes(Class<?> raw, MapperConf
226226

227227
@Override
228228
public JavaType resolveType(Type type) {
229+
// 05-Sep-2020, tatu: [databind#2846][databind#2821] avoid
230+
// passing context in case of Raw class (generic type declared
231+
// without type parametrers) as that can lead to mismatch
232+
if (type instanceof Class<?>) {
233+
return _typeFactory.constructType(type);
234+
}
229235
return _typeFactory.constructType(type, _bindings);
230236
}
231237

0 commit comments

Comments
 (0)