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
Say you have some JSON with an array somewhere inside, like this:
{"a": [1], "b": "the end"}
If you parse to the start of the array, then call parser.getArrayStream().iterator(), you get an iterator, which i believe should iterate over the contents of the array, and then stop. And indeed, you do. But if you then call hasNext() on the iterator again, it surprisingly returns true, and if you call next(), it returns a JsonValue containing the string "b" - this is the next object key after the end of the array!
Say you have some JSON with an array somewhere inside, like this:
If you parse to the start of the array, then call
parser.getArrayStream().iterator()
, you get an iterator, which i believe should iterate over the contents of the array, and then stop. And indeed, you do. But if you then callhasNext()
on the iterator again, it surprisingly returns true, and if you callnext()
, it returns a JsonValue containing the string "b" - this is the next object key after the end of the array!Here's a JUnit 5 test:
This also happens when the array is nested inside another array. There, the iterator iterates over the other elements in the outer array.
Using Joy 2.1.0 with OpenJDK 17+35.
The text was updated successfully, but these errors were encountered: