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
When MappingIterator encounters an Exception, it continues to return hasNext() == true, but next() keeps throwing the same Exception and the parser never modes forward.
Minimal fix for 2.5.2, which will enforce clearing of the last token even if exception is thrown.
This will guarantee that at least one token is read, no matter what. For specific error this will likely produce "partial" objects (since part of the object remains in read stream), which may be problematic.
Caller may try recover using underlying JsonParser, since it may have more knowledge on how to re-sync content (for shallow Objects simply scan past END_OBJECT, for example)
I will also file a follow-up issue for adding better heuristics for re-sync in 2.6 (or later), which should make error recovery more convenient. But for a patch version I don't want any chance of regression, hence keeping this fix very simple.
When
MappingIterator
encounters an Exception, it continues to returnhasNext() == true
, butnext()
keeps throwing the same Exception and the parser never modes forward.I would expect the following code to print:
Or maybe just get to the Exception and then stop. Instead it does:
The text was updated successfully, but these errors were encountered: