Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TreeTraversingParser and UTF8StreamJsonParser create contexts differently #2049

Closed
apetrelli opened this issue May 24, 2018 · 3 comments
Closed
Milestone

Comments

@apetrelli
Copy link

apetrelli commented May 24, 2018

UTF8StreamJsonParser creates a child context every time:

  • it encounters a property
  • if the property is collection-like a new context is born for every element in the collection.

TreeTraversingParser instead creates a child context every time a new object has been created.
The result is that, for collection-like properties, the current value of the current context is first set with the container object, then with the collection itself.

I attach a small test case with two tests in which I created a DeserializerModifier to try to append a parent to all children objects.
jackson-bug-test.zip
I tried with versions 2.9.5 and 2.8.10.

cowtowncoder added a commit that referenced this issue May 25, 2018
@cowtowncoder
Copy link
Member

Possibly dup of #1803? (or just related)

@apetrelli
Copy link
Author

@cowtowncoder no, that issue refers to the passing of parent context externally, instead this issue is about the creation of subcontexts, that in UTF88StreamJsonParser happens more frequently than in TreeTraversingParser.

@cowtowncoder
Copy link
Member

Good news -- finally found time to go back to this, and filed separate #2525 to resolve slightly bigger issue (there is also TokenBuffer to consider).
Provided test now passes: fix will be in 2.11.0, eventually: I am hesitant to make a change in patch for 2.10 (although it is relatively early) just because there is non-trivial chance of some code somewhere relying on some aspects of old handling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants