Commit c3b48f3 1 parent 66af793 commit c3b48f3 Copy full SHA for c3b48f3
File tree 4 files changed +27
-3
lines changed
main/java/com/fasterxml/jackson/dataformat/xml/deser
test/java/com/fasterxml/jackson/dataformat/xml/deser
4 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -243,3 +243,11 @@ Motonori IWAMURO (vmi@github)
243
243
* Contributed fix for #616 : Fix mismatch in `setNextIsUnwrapped(boolean)` in
244
244
`XmlBeanSerializerBase#serializeFieldsFiltered()`
245
245
(2.16.1 )
246
+
247
+ Dennis Cornwell (@cornwe19)
248
+
249
+ * Reported #509 : Exception when parsing `List`s of mixed content (since 2.13.0 )
250
+
251
+ Christopher R. Wicks (@wickstopher)
252
+
253
+ * Contributed fix for #509 : Exception when parsing `List`s of mixed content (since 2.13.0 )
Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ Project: jackson-dataformat-xml
4
4
=== Releases ===
5
5
------------------------------------------------------------------------
6
6
7
+ 2.16.3 (not yet released)
8
+
9
+ #509 : Exception when parsing `List`s of mixed content (since 2.13.0 )
10
+ (reported by Dennis C)
11
+ (fix contributed by Christopher R. W)
12
+
7
13
2.16.2 (09 -Mar-2024 )
8
14
9
15
No changes since 2.16.1
Original file line number Diff line number Diff line change @@ -847,9 +847,17 @@ public JsonToken nextToken() throws IOException
847
847
}
848
848
// 29-Mar-2021, tatu: This seems like an error condition...
849
849
// How should we indicate it? As of 2.13, report as unexpected state
850
+ /*
850
851
throw _constructError(
851
- "Unexpected non-whitespace text ('" +_currText +"' in Array context: should not occur (or should be handled)"
852
+ "Unexpected non-whitespace text ('"+_currText+"') in Array context: should not occur (or should be handled)"
852
853
);
854
+ */
855
+
856
+ // [dataformat-xml#509] 2.13 introduced a defect in which an Exception was thrown above, breaking
857
+ // parsing of mixed content arrays (https://github.com/FasterXML/jackson-dataformat-xml/issues/509).
858
+ // This exception case was removed to enable continued support of that functionality, but more
859
+ // robust state handling may be in order.
860
+ // See comment https://github.com/FasterXML/jackson-dataformat-xml/pull/604
853
861
}
854
862
855
863
// If not a leaf (or otherwise ignorable), need to transform into property...
Original file line number Diff line number Diff line change 1
- package com .fasterxml .jackson .dataformat .xml .failing ;
1
+ package com .fasterxml .jackson .dataformat .xml .deser ;
2
2
3
3
import java .util .*;
4
4
5
5
import org .junit .Test ;
6
6
7
7
import com .fasterxml .jackson .annotation .JsonPropertyOrder ;
8
-
9
8
import com .fasterxml .jackson .dataformat .xml .XmlMapper ;
9
+ import com .fasterxml .jackson .dataformat .xml .annotation .JacksonXmlElementWrapper ;
10
10
import com .fasterxml .jackson .dataformat .xml .annotation .JacksonXmlProperty ;
11
11
import com .fasterxml .jackson .dataformat .xml .annotation .JacksonXmlText ;
12
12
@@ -31,6 +31,8 @@ public void setKey(java.lang.String value) {
31
31
}
32
32
33
33
static class MetaData {
34
+ @ JacksonXmlElementWrapper (useWrapping = false )
35
+ @ JacksonXmlProperty (localName = "data" )
34
36
protected List <Data > data ;
35
37
36
38
public List <Data > getData () {
You can’t perform that action at this time.
0 commit comments