Skip to content

Commit 1d75c5c

Browse files
committed
Merge branch '2.10'
2 parents e526573 + 648d5f9 commit 1d75c5c

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

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

+15-2
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ public JsonToken nextToken() throws IOException
458458
return t;
459459
}
460460
*/
461-
461+
462462
// public JsonToken nextToken0() throws IOException
463463
@Override
464464
public JsonToken nextToken() throws IOException
@@ -544,7 +544,10 @@ public JsonToken nextToken() throws IOException
544544
_parsingContext = _parsingContext.createChildObjectContext(-1, -1);
545545
return (_currToken = JsonToken.START_OBJECT);
546546
}
547-
return (_currToken = JsonToken.VALUE_NULL);
547+
// 07-Sep-2019, tatu: for [dataformat-xml#353], must NOT return second null
548+
if (_currToken != JsonToken.VALUE_NULL) {
549+
return (_currToken = JsonToken.VALUE_NULL);
550+
}
548551
}
549552
_currToken = _parsingContext.inArray() ? JsonToken.END_ARRAY : JsonToken.END_OBJECT;
550553
_parsingContext = _parsingContext.getParent();
@@ -622,6 +625,16 @@ public JsonToken nextToken() throws IOException
622625
/**********************************************************************
623626
*/
624627

628+
/*
629+
@Override
630+
public String nextFieldName() throws IOException {
631+
if (nextToken() == JsonToken.FIELD_NAME) {
632+
return getCurrentName();
633+
}
634+
return null;
635+
}
636+
*/
637+
625638
/**
626639
* Method overridden to support more reliable deserialization of
627640
* String collections.

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

+3
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ public int next() throws XMLStreamException
189189
case XML_TEXT:
190190
System.out.println(" XML-token: XML_TEXT '"+_textValue+"'");
191191
break;
192+
case XML_NULL:
193+
System.out.println(" XML-token: XML_NULL");
194+
break;
192195
case XML_END:
193196
System.out.println(" XML-token: XML_END");
194197
break;

0 commit comments

Comments
 (0)