Skip to content

Commit 2cfc7d7

Browse files
committed
Do not call _yamlParser.hasNext() to wrap the exception
1 parent 472e426 commit 2cfc7d7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/YAMLParser.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public JsonToken nextToken() throws IOException
282282
return null;
283283
}
284284

285-
while (_yamlParser.hasNext()) {
285+
while (true /*_yamlParser.hasNext()*/) {
286286
Event evt;
287287
try {
288288
evt = _yamlParser.next();
@@ -386,8 +386,6 @@ public JsonToken nextToken() throws IOException
386386
continue;
387387
}
388388
}
389-
//TODO what should be thrown here ?
390-
throw new RuntimeException("Unexpected events.");
391389
}
392390

393391
protected JsonToken _decodeScalar(ScalarEvent scalar) throws IOException

0 commit comments

Comments
 (0)