Skip to content

Fix XML isNull() misclassifying structure list members as null - #1330

Merged
joewyz merged 1 commit into
mainfrom
joewyz/xml-fix
Aug 20, 2026
Merged

Fix XML isNull() misclassifying structure list members as null#1330
joewyz merged 1 commit into
mainfrom
joewyz/xml-fix

Conversation

@joewyz

@joewyz joewyz commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

What behavior changes?

The XML deserializer misjudged the nullability of a list element whose value is a structure when the XML was compact (no whitespace between the element and its firstchild).
For example, the following raises SerializationException("Null value found in dense list"): the <member> element has no direct text all its data is in child elements. reader.getText().isEmpty() evaluates to true inside isNull() in XmlDeserializer, and the member is wrongly treated as null.

<DenseListStruct><structs><member><id>abcd</id></member></structs></DenseListStruct>

This PR fixes it by additionally checking that the reader is at the element's END_ELEMENT, so only a genuinely empty element is treated as null.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@joewyz
joewyz merged commit c2f46a4 into main Aug 20, 2026
5 checks passed
@joewyz
joewyz deleted the joewyz/xml-fix branch August 20, 2026 21:47
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.

3 participants