Skip to content

Commit 9c14c46

Browse files
committed
Remove initial work in 2.11 wrt #2539 (leave supporting Deserializers stuff, but method from PTV)
1 parent b68a1c0 commit 9c14c46

File tree

2 files changed

+11
-22
lines changed

2 files changed

+11
-22
lines changed

src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public abstract class DeserializationContext
6060
/* Configuration, immutable
6161
/**********************************************************
6262
*/
63-
63+
6464
/**
6565
* Object that handle details of {@link JsonDeserializer} caching.
6666
*/

src/main/java/com/fasterxml/jackson/databind/jsontype/BasicPolymorphicTypeValidator.java

+10-21
Original file line numberDiff line numberDiff line change
@@ -296,35 +296,24 @@ public boolean match(MapperConfig<?> config, Class<?> clazz) {
296296
});
297297
}
298298

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+
/*
320303
public Builder allowSubTypesWithExplicitDeserializer() {
321304
return _appendSubClassMatcher(new TypeMatcher() {
322305
@Override
323306
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
324312
return clazz.isArray();
325313
}
326314
});
327315
}
316+
*/
328317

329318
public BasicPolymorphicTypeValidator build() {
330319
return new BasicPolymorphicTypeValidator(_invalidBaseTypes,

0 commit comments

Comments
 (0)