-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Using @JsonUnwrapped annotation in builderdeserializer hangs in infinite loop #1978
Comments
Master is for Jackson 3.0, so simple merging is probably not possible. |
Ok. So I worked a bit to get a minimalistic example. It seems the crucial part is combining:
Please find attached a zip with all needed files. run the Processor class and it will hang infinitely. If somebody would let me know how to import databind in eclipse I would have tried to get it into a junit test, but this should illustrate the issue. @ |
Thank you! I hope to add changes for 2.9.5, sounds like a nasty situation and best avoided :) |
Well, the thing is we have a data model which has to be reconciled with
many different data files, in json, xml and csv formats with difderent
fields. New external formats for import are added regularly.... This leads
us to use the mixins + builders setup to minimize the effort to create a
new interface.
Thanks for the effort!
Op do 22 mrt. 2018 20:44 schreef Tatu Saloranta <[email protected]>:
… Thank you! I hope to add changes for 2.9.5, sounds like a nasty situation
and best avoided :)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1978 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACC7cuOMRdH5M8KjFhOdIMT63MQaKWEnks5tg_8PgaJpZM4S1jtd>
.
|
@roeltje25 What I meant by "best avoided" was reference to infinite-loop occurring, not configuration that (currently) triggers it. Just in case that was ambiguous. So even if there was configuration that couldn't work, it should be signaled with better mechanism. |
Changed to prevent infinite loop, but I think this is just a side-effect, so created #1979 for hopefully figuring that out. I think buffering is either missing |
We are using a builder to deserialize a bean and one of the properties is annotated with a @JsonUnwrapped annotation. The code hangs in BuilderBasedDeserializer.java in method deserializeWithObject in the loop starting on line 307. The code of that loop differs significantly from the code i see in master where the loop starts on line 340. The 2.9.4 version of the loop that I am using hangs as there seems to be no end token. p.nextToken() returns null indicating the last token was consumed but this value is not checked making the loop stuck for eternity...
I guess the code in master improves on the behavior in the 2.9 branch. Perhaps this should be merged to 2.9?
Thanks in advance for any fix.
The text was updated successfully, but these errors were encountered: