Skip to content

Commit d05688e

Browse files
committed
Merge branch '2.16' into 2.17
2 parents 120b2bb + c3b48f3 commit d05688e

File tree

4 files changed

+29
-3
lines changed

4 files changed

+29
-3
lines changed

release-notes/CREDITS-2.x

+10
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,16 @@ Motonori IWAMURO (@vmi)
244244
`XmlBeanSerializerBase#serializeFieldsFiltered()`
245245
(2.16.1)
246246

247+
Dennis Cornwell (@cornwe19)
248+
249+
* Reported #509: Exception when parsing `List`s of mixed content (since 2.13.0)
250+
(2.16.3)
251+
252+
Christopher R. Wicks (@wickstopher)
253+
254+
* Contributed fix for #509: Exception when parsing `List`s of mixed content (since 2.13.0)
255+
(2.16.3)
256+
247257
Arthur Chan (@arthurscchan)
248258

249259
* Reported, contributed fix for #618: `ArrayIndexOutOfBoundsException` thrown for invalid

release-notes/VERSION-2.x

+6
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ No changes since 2.17
3333
(contributed by Alex H)
3434
* Upgrade Woodstox to 6.6.1 (latest at the time)
3535

36+
2.16.3 (not yet released)
37+
38+
#509: Exception when parsing `List`s of mixed content (since 2.13.0)
39+
(reported by Dennis C)
40+
(fix contributed by Christopher R. W)
41+
3642
2.16.2 (09-Mar-2024)
3743

3844
No changes since 2.16.1

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

+9-1
Original file line numberDiff line numberDiff line change
@@ -881,9 +881,17 @@ public JsonToken nextToken() throws IOException
881881
}
882882
// 29-Mar-2021, tatu: This seems like an error condition...
883883
// How should we indicate it? As of 2.13, report as unexpected state
884+
/*
884885
throw _constructError(
885-
"Unexpected non-whitespace text ('"+_currText+"' in Array context: should not occur (or should be handled)"
886+
"Unexpected non-whitespace text ('"+_currText+"') in Array context: should not occur (or should be handled)"
886887
);
888+
*/
889+
890+
// [dataformat-xml#509] 2.13 introduced a defect in which an Exception was thrown above, breaking
891+
// parsing of mixed content arrays (https://github.com/FasterXML/jackson-dataformat-xml/issues/509).
892+
// This exception case was removed to enable continued support of that functionality, but more
893+
// robust state handling may be in order.
894+
// See comment https://github.com/FasterXML/jackson-dataformat-xml/pull/604
887895
}
888896

889897
// If not a leaf (or otherwise ignorable), need to transform into property...

src/test/java/com/fasterxml/jackson/dataformat/xml/failing/UnexpectedNonWhitespaceText509Test.java src/test/java/com/fasterxml/jackson/dataformat/xml/deser/UnexpectedNonWhitespaceText509Test.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
package com.fasterxml.jackson.dataformat.xml.failing;
1+
package com.fasterxml.jackson.dataformat.xml.deser;
22

33
import java.util.*;
44

55
import org.junit.Test;
66

77
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
8-
98
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
9+
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
1010
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
1111
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText;
1212

@@ -31,6 +31,8 @@ public void setKey(java.lang.String value) {
3131
}
3232

3333
static class MetaData {
34+
@JacksonXmlElementWrapper(useWrapping = false)
35+
@JacksonXmlProperty(localName = "data")
3436
protected List<Data> data;
3537

3638
public List<Data> getData() {

0 commit comments

Comments
 (0)