Skip to content

Fix leading digit in AlwaysOnBase64NameProcessor encoded names - #895

Merged
cowtowncoder merged 6 commits into
FasterXML:3.xfrom
Sahana2524:alwayson-base64-name-start
Aug 22, 2026
Merged

Fix leading digit in AlwaysOnBase64NameProcessor encoded names#895
cowtowncoder merged 6 commits into
FasterXML:3.xfrom
Sahana2524:alwayson-base64-name-start

Conversation

@Sahana2524

Copy link
Copy Markdown
Contributor

AlwaysOnBase64NameProcessor can emit names that start with a digit
base64url's alphabet includes digits, so any name whose first character is U+0400 or above (Cyrillic, Arabic, CJK, emoji, and so on) encodes to a leading digit, which is not a valid XML name start; Woodstox does not validate names, so the write succeeds but the output no longer parses back, which loses the round trip this always-on processor is meant to provide. I restore a valid start character by prepending a single _ when the encoding begins with one that can't start a name, and strip it back off on decode; a base64url encoding of UTF-8 bytes never begins with _ on its own, so the marker stays unambiguous, the mapping stays one-to-one, and letter-leading names go out exactly as before.

@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 74.14% 📈 +0.090%
Branches branches 68.92% 📈 +0.090%

Coverage data generated from JaCoCo test results

@cowtowncoder cowtowncoder changed the title fix leading digit in AlwaysOnBase64NameProcessor encoded names Fix leading digit in AlwaysOnBase64NameProcessor encoded names Aug 22, 2026
@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 74.19% 📈 +0.080%
Branches branches 68.86% 📈 +0.090%

Coverage data generated from JaCoCo test results

@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 74.19% 📈 +0.080%
Branches branches 68.86% 📈 +0.090%

Coverage data generated from JaCoCo test results

Javadoc still claimed no prefix is ever added, which no longer holds for
names encoding to a leading digit (U+0400 and above).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 74.19% 📈 +0.080%
Branches branches 68.86% 📈 +0.090%

Coverage data generated from JaCoCo test results

…se64 tests

Existing test only checked that no element name starts with a digit, which
would still pass if the marker scheme changed. Assert the exact encoded
names, add the U+03FF/U+0400 boundary where the marker starts being needed,
and cover attribute names (same NameStartChar rule, same call site).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 74.19% 📈 +0.080%
Branches branches 68.86% 📈 +0.090%

Coverage data generated from JaCoCo test results

@cowtowncoder cowtowncoder added this to the 3.3.0 milestone Aug 22, 2026
@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 74.19% 📈 +0.080%
Branches branches 68.97% 📈 +0.200%

Coverage data generated from JaCoCo test results

@cowtowncoder
cowtowncoder merged commit c3584c7 into FasterXML:3.x Aug 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants