@@ -296,35 +296,24 @@ public boolean match(MapperConfig<?> config, Class<?> clazz) {
296
296
});
297
297
}
298
298
299
- /**
300
- * Method for appending matcher that will allow all subtypes for which a
301
- * {@link com.fasterxml.jackson.databind.JsonDeserializer})
302
- * is explicitly provided by either {@code jackson-databind} itself or one of registered
303
- * {@link com.fasterxml.jackson.databind.Module}s.
304
- * Determination is implementation by calling
305
- * {@link com.fasterxml.jackson.databind.deser.DeserializerFactory#hasExplicitDeserializerFor}.
306
- *<p>
307
- * In practice this matcher should remove the need to register any standard Jackson-supported
308
- * JDK types, as well as most if not all 3rd party types; leaving only POJOs and those 3rd party
309
- * types that are not supported by relevant modules. In turn this should not open security
310
- * holes to "gadget" types since insecure types should not be supported by datatype modules.
311
- * For highest security cases (where input is untrusted) it is still preferable to add
312
- * more specific allow-rules, if possible.
313
- *<p>
314
- * NOTE: Modules need to provide support for detection so if 3rd party types do not seem to
315
- * be supported, Module in question may need to be updated to indicate existence of explicit
316
- * deserializers.
317
- *
318
- * @since 2.11
319
- */
299
+ // 18-Nov-2019, tatu: alas, [databind#2539] can not be implemented with 2.x due
300
+ // to (in hindsight) obvious design flaw: instead `MapperConfig`, `DatabindContext`
301
+ // must be available to check what deserializers are registered.
302
+ /*
320
303
public Builder allowSubTypesWithExplicitDeserializer() {
321
304
return _appendSubClassMatcher(new TypeMatcher() {
322
305
@Override
323
306
public boolean match(MapperConfig<?> config, Class<?> clazz) {
307
+ // First things first: "peel off" array type
308
+ while (clazz.isArray()) {
309
+ clazz = clazz.getComponentType();
310
+ }
311
+ DeserializerFactory df = ((DeserializationConfig) config).getDes
324
312
return clazz.isArray();
325
313
}
326
314
});
327
315
}
316
+ */
328
317
329
318
public BasicPolymorphicTypeValidator build () {
330
319
return new BasicPolymorphicTypeValidator (_invalidBaseTypes ,
0 commit comments