Skip to content

Fix Unicode case expansion in AdjustCase - #101

Closed
krotname wants to merge 1 commit into
mainfrom
codex/fix-unicode-case-expansion-regression
Closed

Fix Unicode case expansion in AdjustCase#101
krotname wants to merge 1 commit into
mainfrom
codex/fix-unicode-case-expansion-regression

Conversation

@krotname

@krotname krotname commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Repair a Unicode correctness regression in adjustCaseToLower where lowercasing the whole string first could produce multi-code-point expansions (e.g. U+0130 → i + combining dot) and leave the combining mark in the suffix.

Description

  • Change the order of operations to separate the original first UTF-16 unit and then lowercase the remainder with string.substring(1).toLowerCase(Locale.ROOT) to avoid retaining extra code points produced by the first character's case mapping.
  • Preserve the original behavior of uppercasing the first unit via string.substring(0, 1).toUpperCase(Locale.ROOT) and concatenating it with the lowercased suffix.
  • Add a focused regression test adjustsSuffixWithoutRetainingExpandedLowercaseCharacters that asserts other.AdjustCase.adjustCaseToLower("\u0130BC") yields "\u0130bc".

Testing

  • Ran mvn -Dtest=AdjustCaseTest test and the test suite containing the new regression test completed successfully (Tests run: 2, Failures: 0).
  • Ran git diff --check and git status to ensure no whitespace or repository issues and a clean working tree.
  • The change is limited and unit-tested to prevent reintroduction of the combining-character regression.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5972e0f5be

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/main/java/other/AdjustCase.java
@krotname

krotname commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

Закрываю как superseded by #116: изменения перенесены в одну проверенную ветку, все review findings учтены; локальный mvn verify прошёл полностью.

@krotname krotname closed this Aug 1, 2026
@krotname
krotname deleted the codex/fix-unicode-case-expansion-regression branch August 1, 2026 08:36
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.

1 participant