@@ -197,6 +197,17 @@ public String findTypeName(AnnotatedClass ac) {
197
197
return (String ) values .get ("findTypeName" );
198
198
}
199
199
200
+ /*
201
+ /******************************************************
202
+ /* Deserialization introspection
203
+ /******************************************************
204
+ */
205
+
206
+ @ Override
207
+ public Boolean hasAnySetter (Annotated a ) {
208
+ return (Boolean ) values .get ("hasAnySetter" );
209
+ }
210
+
200
211
/*
201
212
/******************************************************
202
213
/* Helper methods
@@ -215,7 +226,7 @@ private boolean _boolean(String key) {
215
226
/**********************************************************
216
227
*/
217
228
218
- private final IntrospectorWithMap NO_ANNOTATIONS = new IntrospectorWithMap ();
229
+ private final AnnotationIntrospector NO_ANNOTATIONS = AnnotationIntrospector . nopInstance ();
219
230
220
231
public void testVersion () throws Exception
221
232
{
@@ -225,8 +236,9 @@ public void testVersion() throws Exception
225
236
.version (v );
226
237
assertEquals (v ,
227
238
new AnnotationIntrospectorPair (withVersion , NO_ANNOTATIONS ).version ());
239
+ IntrospectorWithMap noVersion = new IntrospectorWithMap ();
228
240
assertEquals (Version .unknownVersion (),
229
- new AnnotationIntrospectorPair (NO_ANNOTATIONS , withVersion ).version ());
241
+ new AnnotationIntrospectorPair (noVersion , withVersion ).version ());
230
242
}
231
243
232
244
public void testAccess () throws Exception
@@ -395,7 +407,7 @@ public void testFindDeserializer() throws Exception
395
407
/******************************************************
396
408
/* Property auto-detection
397
409
/******************************************************
398
- */
410
+ */
399
411
400
412
public void testFindAutoDetectVisibility () throws Exception
401
413
{
@@ -414,7 +426,7 @@ public void testFindAutoDetectVisibility() throws Exception
414
426
/******************************************************
415
427
/* Type handling
416
428
/******************************************************
417
- */
429
+ */
418
430
419
431
public void testFindTypeResolver () throws Exception
420
432
{
@@ -445,6 +457,29 @@ public void testFindTypeName() {
445
457
new AnnotationIntrospectorPair (intr2 , intr1 ).findTypeName (null ));
446
458
}
447
459
460
+ /*
461
+ /******************************************************
462
+ /* Deserialization introspection
463
+ /******************************************************
464
+ */
465
+
466
+ // for [databind#1672]
467
+ public void testHasAnySetter () {
468
+ IntrospectorWithMap intr1 = new IntrospectorWithMap ()
469
+ .add ("hasAnySetter" , Boolean .TRUE );
470
+ IntrospectorWithMap intr2 = new IntrospectorWithMap ()
471
+ .add ("hasAnySetter" , Boolean .FALSE );
472
+ assertNull (new AnnotationIntrospectorPair (NO_ANNOTATIONS , NO_ANNOTATIONS ).hasAnySetter (null ));
473
+ assertEquals (Boolean .TRUE ,
474
+ new AnnotationIntrospectorPair (intr1 , intr2 ).hasAnySetter (null ));
475
+ assertEquals (Boolean .TRUE ,
476
+ new AnnotationIntrospectorPair (NO_ANNOTATIONS , intr1 ).hasAnySetter (null ));
477
+ assertEquals (Boolean .FALSE ,
478
+ new AnnotationIntrospectorPair (intr2 , intr1 ).hasAnySetter (null ));
479
+ assertEquals (Boolean .FALSE ,
480
+ new AnnotationIntrospectorPair (NO_ANNOTATIONS , intr2 ).hasAnySetter (null ));
481
+ }
482
+
448
483
/*
449
484
/**********************************************************
450
485
/* Test methods, others
0 commit comments