File tree 2 files changed +18
-2
lines changed
src/main/java/com/fasterxml/jackson/dataformat/xml/deser
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -458,7 +458,7 @@ public JsonToken nextToken() throws IOException
458
458
return t;
459
459
}
460
460
*/
461
-
461
+
462
462
// public JsonToken nextToken0() throws IOException
463
463
@ Override
464
464
public JsonToken nextToken () throws IOException
@@ -544,7 +544,10 @@ public JsonToken nextToken() throws IOException
544
544
_parsingContext = _parsingContext .createChildObjectContext (-1 , -1 );
545
545
return (_currToken = JsonToken .START_OBJECT );
546
546
}
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
+ }
548
551
}
549
552
_currToken = _parsingContext .inArray () ? JsonToken .END_ARRAY : JsonToken .END_OBJECT ;
550
553
_parsingContext = _parsingContext .getParent ();
@@ -622,6 +625,16 @@ public JsonToken nextToken() throws IOException
622
625
/**********************************************************************
623
626
*/
624
627
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
+
625
638
/**
626
639
* Method overridden to support more reliable deserialization of
627
640
* String collections.
Original file line number Diff line number Diff line change @@ -189,6 +189,9 @@ public int next() throws XMLStreamException
189
189
case XML_TEXT:
190
190
System.out.println(" XML-token: XML_TEXT '"+_textValue+"'");
191
191
break;
192
+ case XML_NULL:
193
+ System.out.println(" XML-token: XML_NULL");
194
+ break;
192
195
case XML_END:
193
196
System.out.println(" XML-token: XML_END");
194
197
break;
You can’t perform that action at this time.
0 commit comments