Skip to content

Commit a5f2eda

Browse files
committed
Fix #242
1 parent 562c8cd commit a5f2eda

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

release-notes/CREDITS-2.x

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ Yury Vasyutinskiy (Falland@github)
3131
* Contributed #232: Implement `writeRawValue` in `ToXmlGenerator`
3232
(2.9.0)
3333

34+
Victor Khovanskiy (khovanskiy@githib)
35+
36+
* Reported #242: Deserialization of class inheritance depends on attributes order
37+
(2.10.0)
38+
3439
Nelson Dionisi (ndionisi@github)
3540

3641
* Reported #333: `OutputDecorator` not called with `XmlMapper`

release-notes/VERSION-2.x

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ Project: jackson-dataformat-xml
44
= Releases
55
------------------------------------------------------------------------
66

7+
2.10.0 (not yet released)
8+
9+
#242: Deserialization of class inheritance depends on attributes order
10+
(reported by Victor K)
11+
712
2.10.0.pr2 (31-Aug-2019)
813

914
#351: XmlBeanSerializer serializes AnyGetters field even with FilterExceptFilter

src/main/java/com/fasterxml/jackson/dataformat/xml/deser/WrapperHandlingDeserializer.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.util.*;
55

66
import com.fasterxml.jackson.core.JsonParser;
7+
import com.fasterxml.jackson.core.util.JsonParserDelegate;
78
import com.fasterxml.jackson.databind.*;
89
import com.fasterxml.jackson.databind.deser.*;
910
import com.fasterxml.jackson.databind.deser.std.DelegatingDeserializer;
@@ -136,11 +137,15 @@ public Object deserializeWithType(JsonParser p, DeserializationContext ctxt,
136137
/**********************************************************************
137138
*/
138139

140+
@SuppressWarnings("resource")
139141
protected final void _configureParser(JsonParser p) throws IOException
140142
{
141-
// 19-Aug-2013, tatu: Although we should not usually get called with
142-
// parser of other types, there are some cases where this may happen:
143-
// specifically, during structural value conversions.
143+
// 05-Sep-2019, tatu: May get XML parser, except for case where content is
144+
// buffered. In that case we may still have access to real parser if we
145+
// are lucky (like in [dataformat-xml#242])
146+
while (p instanceof JsonParserDelegate) {
147+
p = ((JsonParserDelegate) p).delegate();
148+
}
144149
if (p instanceof FromXmlParser) {
145150
((FromXmlParser) p).addVirtualWrapping(_namesToWrap);
146151
}

src/test/java/com/fasterxml/jackson/dataformat/xml/failing/TypeAttributeOrder242Test.java renamed to src/test/java/com/fasterxml/jackson/dataformat/xml/deser/TypeAttributeOrder242Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fasterxml.jackson.dataformat.xml.failing;
1+
package com.fasterxml.jackson.dataformat.xml.deser;
22

33
import java.util.List;
44

0 commit comments

Comments
 (0)