Skip to content

Use Locale.ROOT for case folding in CaseInsensitiveNameSet#879

Merged
cowtowncoder merged 3 commits into
FasterXML:3.xfrom
Sahana2524:caseinsensitive-name-locale
Jul 22, 2026
Merged

Use Locale.ROOT for case folding in CaseInsensitiveNameSet#879
cowtowncoder merged 3 commits into
FasterXML:3.xfrom
Sahana2524:caseinsensitive-name-locale

Conversation

@Sahana2524

Copy link
Copy Markdown
Contributor

CaseInsensitiveNameSet folds names with the JVM default locale, so case-insensitive element matching quietly breaks for names containing I/i once the default is a locale like Turkish:

  • construct() and contains() both call String.toLowerCase() with no locale, so a wrapper name like ITEM stops matching an incoming item when the default locale is tr ("ITEM".toLowerCase() becomes dotless ıtem)
  • the names being matched are element/attribute names from the parsed document, and this feeds unwrapped-list wrapping via FromXmlParser.addVirtualWrapping when ACCEPT_CASE_INSENSITIVE_PROPERTIES is on, so the result ends up depending on server locale
  • XmlTokenBuffer already matches the same names with equalsIgnoreCase, which is locale independent, so this helper is the odd one out

Both calls now use Locale.ROOT. Pure-ASCII names, the common case, are unchanged.

@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 73.55% 📈 +0.020%
Branches branches 68.08% 📈 +0.050%

Coverage data generated from JaCoCo test results

@cowtowncoder cowtowncoder added the cla-needed CLA is required (but not yet received) for PR label Jul 16, 2026
@cowtowncoder

Copy link
Copy Markdown
Member

Looks good -- just need CLA.

@Sahana2524

Copy link
Copy Markdown
Contributor Author

Sure, I'll email the signed CLA to info@fasterxml. Saw your note on #878 that one copy covers both PRs, so that's the plan.

@cowtowncoder cowtowncoder added cla-received PR already covered by CLA (optional label) and removed cla-needed CLA is required (but not yet received) for PR labels Jul 21, 2026
@cowtowncoder cowtowncoder changed the title use Locale.ROOT for case folding in CaseInsensitiveNameSet Use Locale.ROOT for case folding in CaseInsensitiveNameSet Jul 22, 2026
@cowtowncoder
cowtowncoder merged commit 86370b9 into FasterXML:3.x Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-received PR already covered by CLA (optional label)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants