Skip to content

Commit 3e28102

Browse files
committed
Merge branch '2.18' into 2.19
2 parents 78297f0 + e5ba603 commit 3e28102

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

release-notes/VERSION-2.x

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Project: jackson-databind
5454
#4790: Fix `@JsonAnySetter` issue with "setter" method (related to #4639)
5555
(reported by @bsa01)
5656
(fix by Joo-Hyuk K)
57+
#4807: Improve `FactoryBasedEnumDeserializer` to work better with XML module
5758

5859
2.18.1 (28-Oct-2024)
5960

src/main/java/com/fasterxml/jackson/databind/deser/std/FactoryBasedEnumDeserializer.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,11 @@ public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOEx
164164
if (unwrapping) {
165165
t = p.nextToken();
166166
}
167-
if ((t == null) || !t.isScalarValue()) {
167+
// 24-Nov-2024, tatu: New! "Scalar from Object" (mostly for XML) -- see
168+
// https://github.com/FasterXML/jackson-databind/issues/4807
169+
if (t == JsonToken.START_OBJECT) {
170+
value = ctxt.extractScalarFromObject(p, this, _valueClass);
171+
} else if ((t == null) || !t.isScalarValue()) {
168172
// Could argue we should throw an exception but...
169173
// 01-Jun-2023, tatu: And now we will finally do it!
170174
final JavaType targetType = getValueType(ctxt);

0 commit comments

Comments
 (0)