Skip to content

Commit 648d5f9

Browse files
committed
Minor fix wrt #353
1 parent f8db60e commit 648d5f9

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ public JsonToken nextToken() throws IOException
472472
return t;
473473
}
474474
*/
475-
475+
476476
// public JsonToken nextToken0() throws IOException
477477
@Override
478478
public JsonToken nextToken() throws IOException
@@ -558,7 +558,10 @@ public JsonToken nextToken() throws IOException
558558
_parsingContext = _parsingContext.createChildObjectContext(-1, -1);
559559
return (_currToken = JsonToken.START_OBJECT);
560560
}
561-
return (_currToken = JsonToken.VALUE_NULL);
561+
// 07-Sep-2019, tatu: for [dataformat-xml#353], must NOT return second null
562+
if (_currToken != JsonToken.VALUE_NULL) {
563+
return (_currToken = JsonToken.VALUE_NULL);
564+
}
562565
}
563566
_currToken = _parsingContext.inArray() ? JsonToken.END_ARRAY : JsonToken.END_OBJECT;
564567
_parsingContext = _parsingContext.getParent();
@@ -636,6 +639,16 @@ public JsonToken nextToken() throws IOException
636639
/**********************************************************
637640
*/
638641

642+
/*
643+
@Override
644+
public String nextFieldName() throws IOException {
645+
if (nextToken() == JsonToken.FIELD_NAME) {
646+
return getCurrentName();
647+
}
648+
return null;
649+
}
650+
*/
651+
639652
/**
640653
* Method overridden to support more reliable deserialization of
641654
* String collections.

0 commit comments

Comments
 (0)