@@ -51,7 +51,17 @@ public QName findRootName(Class<?> rootType, MapperConfig<?> config)
5151 if (name != null ) {
5252 return name ;
5353 }
54-
54+ name = _findRootName (rootType , config );
55+ synchronized (_rootNames ) {
56+ _rootNames .put (key , name );
57+ }
58+ return name ;
59+ }
60+
61+ // NOTE: needed to be synchronized in 2.6.4, but 2.7.0 adds a proper fix
62+ // for annotation introspection hence not needed any more
63+ protected QName _findRootName (Class <?> rootType , MapperConfig <?> config )
64+ {
5565 BeanDescription beanDesc = config .introspectClassAnnotations (rootType );
5666 AnnotationIntrospector intr = config .getAnnotationIntrospector ();
5767 AnnotatedClass ac = beanDesc .getClassInfo ();
@@ -68,21 +78,16 @@ public QName findRootName(Class<?> rootType, MapperConfig<?> config)
6878 // Should we strip out enclosing class tho? For now, nope:
6979 // one caveat: array simple names end with "[]"; also, "$" needs replacing
7080 localName = StaxUtil .sanitizeXmlTypeName (rootType .getSimpleName ());
71- name = new QName ("" , localName );
72- } else {
73- // Otherwise let's see if there's namespace, too (if we are missing it)
74- if (ns == null || ns .length () == 0 ) {
75- ns = findNamespace (intr , ac );
76- }
81+ return new QName ("" , localName );
82+ }
83+ // Otherwise let's see if there's namespace, too (if we are missing it)
84+ if (ns == null || ns .length () == 0 ) {
85+ ns = findNamespace (intr , ac );
7786 }
7887 if (ns == null ) { // some QName impls barf on nulls...
7988 ns = "" ;
8089 }
81- name = new QName (ns , localName );
82- synchronized (_rootNames ) {
83- _rootNames .put (key , name );
84- }
85- return name ;
90+ return new QName (ns , localName );
8691 }
8792
8893 private String findNamespace (AnnotationIntrospector ai , AnnotatedClass ann )
0 commit comments