Skip to content

Commit 1348033

Browse files
committed
Change introspection call
1 parent 623e6ad commit 1348033

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

src/main/java/com/fasterxml/jackson/dataformat/xml/ser/XmlSerializerProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void serializeValue(JsonGenerator gen, Object value) throws IOException
6363
} else {
6464
QName rootName = _rootNameFromConfig();
6565
if (rootName == null) {
66-
rootName = _rootNameLookup.findRootName(cls, _config);
66+
rootName = _rootNameLookup.findRootName(this, cls);
6767
}
6868
_initWithRootName(xgen, rootName);
6969
asArray = TypeUtil.isIndexedType(cls);
@@ -102,7 +102,7 @@ public void serializeValue(JsonGenerator gen, Object value, JavaType rootType,
102102
} else {
103103
QName rootName = _rootNameFromConfig();
104104
if (rootName == null) {
105-
rootName = _rootNameLookup.findRootName(rootType, _config);
105+
rootName = _rootNameLookup.findRootName(this, rootType);
106106
}
107107
_initWithRootName(xgen, rootName);
108108
asArray = TypeUtil.isIndexedType(rootType);

src/main/java/com/fasterxml/jackson/dataformat/xml/util/XmlRootNameLookup.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import javax.xml.namespace.QName;
44

55
import com.fasterxml.jackson.databind.*;
6-
import com.fasterxml.jackson.databind.cfg.MapperConfig;
76
import com.fasterxml.jackson.databind.introspect.AnnotatedClass;
87
import com.fasterxml.jackson.databind.type.ClassKey;
98
import com.fasterxml.jackson.databind.util.SimpleLookupCache;
9+
1010
import com.fasterxml.jackson.dataformat.xml.XmlAnnotationIntrospector;
1111

1212
/**
@@ -37,11 +37,11 @@ protected Object readResolve() {
3737
return this;
3838
}
3939

40-
public QName findRootName(JavaType rootType, MapperConfig<?> config) {
41-
return findRootName(rootType.getRawClass(), config);
40+
public QName findRootName(DatabindContext ctxt, JavaType rootType) {
41+
return findRootName(ctxt, rootType.getRawClass());
4242
}
4343

44-
public QName findRootName(Class<?> rootType, MapperConfig<?> config)
44+
public QName findRootName(DatabindContext ctxt, Class<?> rootType)
4545
{
4646
ClassKey key = new ClassKey(rootType);
4747
QName name;
@@ -51,19 +51,17 @@ public QName findRootName(Class<?> rootType, MapperConfig<?> config)
5151
if (name != null) {
5252
return name;
5353
}
54-
name = _findRootName(rootType, config);
54+
name = _findRootName(ctxt, rootType);
5555
synchronized (_rootNames) {
5656
_rootNames.put(key, name);
5757
}
5858
return name;
5959
}
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)
60+
61+
protected QName _findRootName(DatabindContext ctxt, Class<?> rootType)
6462
{
65-
final AnnotatedClass ac = config.introspectClassAnnotations(rootType);
66-
final AnnotationIntrospector intr = config.getAnnotationIntrospector();
63+
final AnnotatedClass ac = ctxt.introspectClassAnnotations(rootType);
64+
final AnnotationIntrospector intr = ctxt.getAnnotationIntrospector();
6765
String localName = null;
6866
String ns = null;
6967

0 commit comments

Comments
 (0)