Skip to content

Decode element name before matching virtual wrapper in _initStartElement - #893

Open
Sahana2524 wants to merge 1 commit into
FasterXML:3.xfrom
Sahana2524:wrapper-match-decoded-name
Open

Decode element name before matching virtual wrapper in _initStartElement#893
Sahana2524 wants to merge 1 commit into
FasterXML:3.xfrom
Sahana2524:wrapper-match-decoded-name

Conversation

@Sahana2524

Copy link
Copy Markdown
Contributor

Unwrapped repeated elements are matched against the active virtual wrapper by raw element name, but the wrapper holds the name after XmlNameProcessor decoding (repeatStartElement stores the decoded _localName/_namespaceURI).

  • with a base64 (or always-on base64) name processor, a repeated <encoded> element never matches its own wrapper, so each item closes the virtual array and only the last one survives
  • reading a 3-item useWrapping=false list under the always-on base64 processor silently yields a 1-item list, with no exception to signal the loss
  • _handleRepeatElement and _handleEndElement already operate on decoded names, so _initStartElement was the only spot comparing before decoding

Fix decodes the name up front and matches on the decoded value; the delayed-replay branch keeps the raw name since _handleRepeatElement decodes it again downstream. Added round-trip tests for the always-on and colliding-prefix base64 processors (both fail on the current tree).

@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 73.72% 📈 +0.010%
Branches branches 68.56% 📈 +0.000%

Coverage data generated from JaCoCo test results

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.

1 participant