Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow-up fix wrt #4783: prevent too early fail on abstract Map types #4794

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -968,13 +968,9 @@ public JsonDeserializer<?> createMapDeserializer(DeserializationContext ctxt,
mapClass = type.getRawClass();
// But if so, also need to re-check creators...
beanDesc = config.introspectForCreation(type);
} else {
// [databind#292]: Actually, may be fine, but only if polymorphic deser enabled
if (type.getTypeHandler() == null) {
throw new IllegalArgumentException("Cannot find a deserializer for non-concrete Map type "+type);
}
deser = AbstractDeserializer.constructForNonPOJO(beanDesc);
}
// 11-Nov-2024, tatu: Related to [databind#4783] let's not fail on
// abstract Maps so they can work with merge (or factory methods)
} else {
// 10-Jan-2017, tatu: `java.util.Collections` types need help:
deser = JavaUtilCollectionsDeserializers.findForMap(ctxt, type);
Expand Down