-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Deserializing fails when using builder classes with Iterable
Collection setters
#646
Comments
@bpasson we don't really have many active maintainers of this repo. I would suggest that this method is a good one to look at if anyone has an interest in trying to fix this. jackson-dataformat-xml/src/main/java/com/fasterxml/jackson/dataformat/xml/util/TypeUtil.java Line 11 in 85905b5
|
First things first: never use this line in Jackson problem reproductions:
as that is known to hide issues left and right and wasting everyone's time. Second: @pjfanning is probably right that specific handling XML backend needs is related to that method. Third: one thing that can help with troubleshooting is to contribute failing (minimal) unit test (under |
@cowtowncoder I added a PR to branch 2.18 which contains the failing test. I did some debugging and found the following piece of code in the
It upgrades jackson-dataformat-xml/src/main/java/com/fasterxml/jackson/dataformat/xml/util/TypeUtil.java Line 11 in 85905b5
It this related to the comment |
Ok, so no, that comment should not be relevant for this purpose (or problem). But the call to |
@cowtowncoder I did a test and If I extend the if clause in What do you think? If it is classified as an It might even make the explicit upgrading in |
@bpasson I think my concern was with the fact that FasterXML/jackson-databind#3950 does not mention this so I guess it could also be an oversight. so... it could be something to improve. I will file an issue for that. Having said that, I think addition in |
@cowtowncoder That sounds sensible. I will update the PR to have The PR now is targeted at 2.18 branch. Is that ok or should I target it at main? |
There is no main branch and master branch is for 3.0. 2.18 will be released before 3.0. |
@bpasson Like @pjfanning mentioned, we'll go with 2.x. But this looks quite safe change so I would accept it against 2.17 as well (for 2.17.1); that will be released before 2.18.0 (as we only just started 2.18 branch, it'll be multiple months). |
@cowtowncoder I opened the PR to 2.17. It contains the fix and I moved the original failing, now working, testcase to the lists test package. |
Iterable
Collection setters
Fix merged in for 2.17.1. |
When using builder classes with method signatures like
Builder orderLines(Iterable<? extends OrderLine> lines)
forcollections, deserialization fails with the following.
A reproducer can be found at https://github.com/bpasson/jackson-dataformat-xml-issue-646
This concerns jackson-dataformat-xml version 2.17.0.
Detailed Example
Consider the following objects:
When deserializing the following XMl document:
Deserializing fails with:
This is caused by the following builder method:
If you use
Iterable<? extends OrderLine>
as method parameter it fails. If you useCollection<? extends OrderLine>
, see commented line above, it works. I expected both to work as is the case for Json binding.The text was updated successfully, but these errors were encountered: