File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
impl/src/main/java/org/glassfish/json
tests/src/test/java/org/glassfish/json/tests Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -330,7 +330,7 @@ public JsonLocation getLastCharLocation() {
330
330
331
331
@ Override
332
332
public boolean hasNext () {
333
- if (stack .isEmpty () && (currentEvent == Event . END_ARRAY || currentEvent == Event .END_OBJECT )) {
333
+ if (stack .isEmpty () && (currentEvent != null && currentEvent . compareTo ( Event .KEY_NAME ) > 0 )) {
334
334
JsonToken token = tokenizer .nextToken ();
335
335
if (token != JsonToken .EOF ) {
336
336
throw new JsonParsingException (JsonMessages .PARSER_EXPECTED_EOF (token ),
Original file line number Diff line number Diff line change @@ -780,6 +780,9 @@ public void testExceptionsFromHasNext() {
780
780
781
781
public void testEOFFromHasNext () {
782
782
checkExceptionFromHasNext ("{ \" d\" : 1 } 2 3 4" );
783
+ checkExceptionFromHasNext ("[ {\" d\" : 1 }] 2 3 4" );
784
+ checkExceptionFromHasNext ("1 2 3 4" );
785
+ checkExceptionFromHasNext ("null 2 3 4" );
783
786
}
784
787
785
788
public void testExceptionsFromNext () {
You can’t perform that action at this time.
0 commit comments