From 9f1aa0f5054a7a75acfc8155df9aee50059fb5da Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Sat, 3 Feb 2024 17:37:46 -0800 Subject: [PATCH] One more fix wrt #637 --- .../xml/JacksonXmlAnnotationIntrospector.java | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/fasterxml/jackson/dataformat/xml/JacksonXmlAnnotationIntrospector.java b/src/main/java/com/fasterxml/jackson/dataformat/xml/JacksonXmlAnnotationIntrospector.java index 144c4582..ee61709d 100644 --- a/src/main/java/com/fasterxml/jackson/dataformat/xml/JacksonXmlAnnotationIntrospector.java +++ b/src/main/java/com/fasterxml/jackson/dataformat/xml/JacksonXmlAnnotationIntrospector.java @@ -197,33 +197,29 @@ public Boolean isOutputAsCData(MapperConfig config, Annotated ann) { @Override public PropertyName findNameForSerialization(Annotated a) { - PropertyName name = _findXmlName(a); - if (name == null) { - name = super.findNameForSerialization(a); - if (name == null) { - if (_hasOneOf(a, ANNOTATIONS_TO_INFER_XML_PROP)) { - return PropertyName.USE_DEFAULT; - } + PropertyName pn = PropertyName.merge(_findXmlName(a), + super.findNameForSerialization(a)); + if (pn == null) { + if (_hasOneOf(a, ANNOTATIONS_TO_INFER_XML_PROP)) { + return PropertyName.USE_DEFAULT; } } - return name; + return pn; } @Override public PropertyName findNameForDeserialization(Annotated a) { - PropertyName name = _findXmlName(a); - if (name == null) { - name = super.findNameForDeserialization(a); - if (name == null) { - if (_hasOneOf(a, ANNOTATIONS_TO_INFER_XML_PROP)) { - return PropertyName.USE_DEFAULT; - } + PropertyName pn = PropertyName.merge(_findXmlName(a), + super.findNameForDeserialization(a)); + if (pn == null) { + if (_hasOneOf(a, ANNOTATIONS_TO_INFER_XML_PROP)) { + return PropertyName.USE_DEFAULT; } } - return name; + return pn; } - + /* /********************************************************************** /* Overrides for non-public helper methods