@@ -252,16 +252,14 @@ protected ValueInstantiator _constructDefaultValueInstantiator(DeserializationCo
252
252
throws JsonMappingException
253
253
{
254
254
final CreatorCollectionState ccState ;
255
- final boolean findImplicit ;
255
+ final ConstructorDetector ctorDetector ;
256
256
257
257
{
258
258
final DeserializationConfig config = ctxt .getConfig ();
259
259
// need to construct suitable visibility checker:
260
260
final VisibilityChecker <?> vchecker = config .getDefaultVisibilityChecker (beanDesc .getBeanClass (),
261
261
beanDesc .getClassInfo ());
262
- // 18-Sep-2020, tatu: Although by default implicit introspection is allowed, 2.12
263
- // has settings to prevent that either generally, or at least for JDK types
264
- findImplicit = config .getConstructorDetector ().allowImplicitCreators (beanDesc .getBeanClass ());
262
+ ctorDetector = config .getConstructorDetector ();
265
263
266
264
// 24-Sep-2014, tatu: Tricky part first; need to merge resolved property information
267
265
// (which has creator parameters sprinkled around) with actual creator
@@ -278,7 +276,7 @@ protected ValueInstantiator _constructDefaultValueInstantiator(DeserializationCo
278
276
}
279
277
280
278
// Start with explicitly annotated factory methods
281
- _addExplicitFactoryCreators (ctxt , ccState , findImplicit );
279
+ _addExplicitFactoryCreators (ctxt , ccState , ! ctorDetector . requireCtorAnnotation () );
282
280
283
281
// constructors only usable on concrete types:
284
282
if (beanDesc .getType ().isConcrete ()) {
@@ -300,6 +298,9 @@ protected ValueInstantiator _constructDefaultValueInstantiator(DeserializationCo
300
298
// TODO: look for `@JsonCreator` annotated ones, throw explicit exception?
301
299
;
302
300
} else {
301
+ // 18-Sep-2020, tatu: Although by default implicit introspection is allowed, 2.12
302
+ // has settings to prevent that either generally, or at least for JDK types
303
+ final boolean findImplicit = ctorDetector .shouldIntrospectorImplicitConstructors (beanDesc .getBeanClass ());
303
304
_addExplicitConstructorCreators (ctxt , ccState , findImplicit );
304
305
if (ccState .hasImplicitConstructorCandidates ()
305
306
&& !ccState .hasExplicitFactories () && !ccState .hasExplicitConstructors ()) {
0 commit comments