Skip to content

Additional tests for string arrays and collections #586

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

Merged
merged 1 commit into from
Mar 19, 2023

Conversation

mbellade
Copy link
Contributor

Following up on #585 with additional tests as suggested. I've added tests for POJOs with a string array or with a list, both are behaving as expected. I also added a test for a simple POJO with just plain string properties to be extra sure nothing breaks.

Regarding this comment:

Ok, this explicit comment makes me nervous: it specifically spells out that when asking from nextTextValue(), empty element should not be coerced into null

I was unsure about that comment too, but it looks like that particular token switch case XmlTokenStream.XML_END_ELEMENT only occurs for null string values (when xsi:nil writing and processing is enabled). The XmlTokenStream.XML_TEXT case is the one that gets triggered in all other cases as well as for empty strings.

@cowtowncoder
Copy link
Member

@mbladel First of all, big thank you for these tests!

And yes, wrt null induction, I was wondering about the exact same thing. Conversion of xsi:nil is not well commented in code but I think your analysis is spot on.
This assessment makes me much more confident in the solution.

@cowtowncoder cowtowncoder merged commit adac623 into FasterXML:2.15 Mar 19, 2023
@mbellade mbellade deleted the string_collections2 branch March 19, 2023 20:35
cowtowncoder added a commit that referenced this pull request Mar 20, 2023
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

Successfully merging this pull request may close these issues.

2 participants