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
I'm working on a program which takes JSON (an exported Trello board), and formats it into a list (each card in a custom format). The beginning process starts by going to the next node in the new JsonParser until it finds the array's key "cards". This works perfectly fine and does eventually find the key.
Bug
The problem occurs during the collection process. At this point, I have the event set to OBJECT_START, and I've already checked if there is a next value. After this, I go into a do-while loop:
Check the event to see how it should be interpreted (create the item, store the current item, get the key, or use the key to store the value in the item).
Get the next node and store the returned event.
Repeat while the parser has a next value.
The first cycle works perfectly fine. But on the next cycle when the event is set to KEY_NAME and I call getString, the returned string is "", when it should have been "id".
Workaround
To resolve this in the mean time, I switched to a while loop (the reverse order, and I do not skip the array's start before the collection process):
While the parser has a next value.
Get the next node and store the returned event.
Check the event to see how it should be interpreted.
This works, but it is undesirable (I already know that there is a next value at the beginning of the loop and should not have to check again).
The text was updated successfully, but these errors were encountered:
Background
I'm working on a program which takes JSON (an exported Trello board), and formats it into a list (each card in a custom format). The beginning process starts by going to the next node in the new JsonParser until it finds the array's key "cards". This works perfectly fine and does eventually find the key.
Bug
The problem occurs during the collection process. At this point, I have the event set to OBJECT_START, and I've already checked if there is a next value. After this, I go into a do-while loop:
The first cycle works perfectly fine. But on the next cycle when the event is set to KEY_NAME and I call getString, the returned string is "", when it should have been "id".
Workaround
To resolve this in the mean time, I switched to a while loop (the reverse order, and I do not skip the array's start before the collection process):
This works, but it is undesirable (I already know that there is a next value at the beginning of the loop and should not have to check again).
The text was updated successfully, but these errors were encountered: