You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #9, since hasNext() is used to check for a next event, and since there's no next event because of an unexpected EOF, shouldn't a JsonParsingException be thrown instead? I'm wondering why this behaviour should be any different than the exceptions expected from the other test cases in these lists (JsonExclusiveBadTerminationTestCase and BadTerminationTestCase).
Open question: When should hasNext() return false and when should it throw an exception due to malformed JSON, i.e. EOF?
Personally, I believe that an unexpected EOF violates the JSON grammar and should cause a parsing exception, and the only time hasNext() should return false is at the end of input.
The text was updated successfully, but these errors were encountered:
@ssilverman
Sorry for my slow response.
I checked the test cases and found inconsistencies in hasNext() method in the Reference Implementation, as shown below.
I believe that all of hasNext() calls in No.1, 4, 6, and 9 should throw JsonParsingException.
If you can agree with me, I will post a new issue in Eclipse Jakarta JSON Processing.
jsonp-test-suite/src/main/java/org/leadpony/jsonp/testsuite/tests/AbstractJsonParserTest.java
Lines 173 to 175 in 5efa996
Similar to #9, since
hasNext()
is used to check for a next event, and since there's no next event because of an unexpected EOF, shouldn't a JsonParsingException be thrown instead? I'm wondering why this behaviour should be any different than the exceptions expected from the other test cases in these lists (JsonExclusiveBadTerminationTestCase
andBadTerminationTestCase
).Open question: When should
hasNext()
return false and when should it throw an exception due to malformed JSON, i.e. EOF?Personally, I believe that an unexpected EOF violates the JSON grammar and should cause a parsing exception, and the only time
hasNext()
should returnfalse
is at the end of input.The text was updated successfully, but these errors were encountered: