Skip to content

Fix JSONML text double decoding with keepStrings - #1085

Open
Boulea7 wants to merge 1 commit into
stleary:masterfrom
Boulea7:fix/jsonml-keep-strings-entities
Open

Boulea7 wants to merge 1 commit into
stleary:masterfrom
Boulea7:fix/jsonml-keep-strings-entities

Conversation

@Boulea7

@Boulea7 Boulea7 commented Oct 2, 2026

Copy link
Copy Markdown

Preserve text already decoded by XMLTokener when keepStrings is enabled. This keeps &amp;lt; as &lt; instead of decoding it again to <, and preserves escaped numeric-reference text.

Fixes #1079.

Regression tests cover both JSONML forms, value types, CDATA, and round trips. The normal and strict-mode suites, Java 6 source/target compilation, and package/Javadoc build pass.

@sonarqubecloud

sonarqubecloud Bot commented Oct 2, 2026

Copy link
Copy Markdown

@stleary

stleary commented Oct 6, 2026

Copy link
Copy Markdown
Owner

What problem does this code solve?
Fixes a bug where JSONML was performing double-decoding with keepStrings enabled

Risks
Low

Changes to the Existing Behavior
Yes, but it is a minor change, and JSONML does not appear to be widely used.

Changes to the API
No

Will this require a new release?
No

Should the documentation be updated?
No

Unit Tests
New unit tests were added

Refactoring
No

Review status
APPROVED

Starting 3-day comment window

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSONML decodes text entities twice with keepStrings enabled

2 participants