Skip to content

Commit 9f1aa0f

Browse files
committed
One more fix wrt #637
1 parent 56a6823 commit 9f1aa0f

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

src/main/java/com/fasterxml/jackson/dataformat/xml/JacksonXmlAnnotationIntrospector.java

+13-17
Original file line numberDiff line numberDiff line change
@@ -197,33 +197,29 @@ public Boolean isOutputAsCData(MapperConfig<?> config, Annotated ann) {
197197
@Override
198198
public PropertyName findNameForSerialization(Annotated a)
199199
{
200-
PropertyName name = _findXmlName(a);
201-
if (name == null) {
202-
name = super.findNameForSerialization(a);
203-
if (name == null) {
204-
if (_hasOneOf(a, ANNOTATIONS_TO_INFER_XML_PROP)) {
205-
return PropertyName.USE_DEFAULT;
206-
}
200+
PropertyName pn = PropertyName.merge(_findXmlName(a),
201+
super.findNameForSerialization(a));
202+
if (pn == null) {
203+
if (_hasOneOf(a, ANNOTATIONS_TO_INFER_XML_PROP)) {
204+
return PropertyName.USE_DEFAULT;
207205
}
208206
}
209-
return name;
207+
return pn;
210208
}
211209

212210
@Override
213211
public PropertyName findNameForDeserialization(Annotated a)
214212
{
215-
PropertyName name = _findXmlName(a);
216-
if (name == null) {
217-
name = super.findNameForDeserialization(a);
218-
if (name == null) {
219-
if (_hasOneOf(a, ANNOTATIONS_TO_INFER_XML_PROP)) {
220-
return PropertyName.USE_DEFAULT;
221-
}
213+
PropertyName pn = PropertyName.merge(_findXmlName(a),
214+
super.findNameForDeserialization(a));
215+
if (pn == null) {
216+
if (_hasOneOf(a, ANNOTATIONS_TO_INFER_XML_PROP)) {
217+
return PropertyName.USE_DEFAULT;
222218
}
223219
}
224-
return name;
220+
return pn;
225221
}
226-
222+
227223
/*
228224
/**********************************************************************
229225
/* Overrides for non-public helper methods

0 commit comments

Comments
 (0)