@@ -207,6 +207,17 @@ public String findTypeName(AnnotatedClass ac) {
207
207
return (String ) values .get ("findTypeName" );
208
208
}
209
209
210
+ /*
211
+ /******************************************************
212
+ /* General member (field, method/constructor) annotations
213
+ /******************************************************
214
+ */
215
+
216
+ @ Override
217
+ public PropertyName findWrapperName (Annotated ann ) {
218
+ return (PropertyName ) values .get ("findWrapperName" );
219
+ }
220
+
210
221
/*
211
222
/******************************************************
212
223
/* Serialization introspection
@@ -386,6 +397,42 @@ public void testFindClassDescription() throws Exception
386
397
387
398
// // // 3 deprecated methods, skip
388
399
400
+ /*
401
+ /**********************************************************
402
+ /* Test methods, general member annotations
403
+ /**********************************************************
404
+ */
405
+
406
+ @ Test
407
+ public void testFindWrapperName () throws Exception
408
+ {
409
+ final PropertyName NAME_WITH_NS = PropertyName .construct ("simple" , "ns" );
410
+ final PropertyName NAME_NO_NS = PropertyName .construct ("other" , null );
411
+
412
+ assertNull (new AnnotationIntrospectorPair (NO_ANNOTATIONS , NO_ANNOTATIONS )
413
+ .findClassDescription (null ));
414
+
415
+ // First: basic merging of namespace/localname info
416
+ IntrospectorWithMap intr1 = new IntrospectorWithMap ()
417
+ .add ("findWrapperName" , NAME_WITH_NS );
418
+ IntrospectorWithMap intr2 = new IntrospectorWithMap ()
419
+ .add ("findWrapperName" , NAME_NO_NS );
420
+ assertSame (NAME_WITH_NS ,
421
+ new AnnotationIntrospectorPair (intr1 , intr2 ).findWrapperName (null ));
422
+ assertEquals (PropertyName .construct ("other" , "ns" ),
423
+ new AnnotationIntrospectorPair (intr2 , intr1 ).findWrapperName (null ));
424
+
425
+ // [databind#4595]: NO_NAME should be retained, not merged
426
+ intr1 = new IntrospectorWithMap ()
427
+ .add ("findWrapperName" , PropertyName .NO_NAME );
428
+ intr2 = new IntrospectorWithMap ()
429
+ .add ("findWrapperName" , NAME_WITH_NS );
430
+ assertSame (PropertyName .NO_NAME ,
431
+ new AnnotationIntrospectorPair (intr1 , intr2 ).findWrapperName (null ));
432
+ assertSame (NAME_WITH_NS ,
433
+ new AnnotationIntrospectorPair (intr2 , intr1 ).findWrapperName (null ));
434
+ }
435
+
389
436
/*
390
437
/**********************************************************
391
438
/* Test methods, ser/deser
0 commit comments