Skip to content

fix(toolkit): correct reverse-search boundary and CharSequence equality - #17

Open
Hanabi9248 wants to merge 2 commits into
IvorySQL:IVYC_REL_5_STABLEfrom
Hanabi9248:codex/reverse-search-zero-index
Open

Hanabi9248 wants to merge 2 commits into
IvorySQL:IVYC_REL_5_STABLEfrom
Hanabi9248:codex/reverse-search-zero-index

Conversation

@Hanabi9248

@Hanabi9248 Hanabi9248 commented Oct 26, 2026 •

Copy link
Copy Markdown

Two public StringUtil API paths return incorrect results for supported inputs:

  • Reverse case-insensitive search skips index zero, so an existing prefix match returns -1. Include index zero while retaining the original starting-index normalization.
  • Case-sensitive equals accepts CharSequence but calls object equality. Distinct StringBuilder/StringBuffer objects containing the same text, or mixed String/builder operands, therefore compare unequal. Compare both textual contents as the existing ignore-case branch already does; preserve null guards and case sensitivity.

The fixes are separate commits and regression runners. The equality addition is based on the already published reverse fix; it retains that production hunk byte-for-byte.

Validation:

  • Reverse fix, earlier accepted version 61dbe1b: baseline four assertion failures and four controls, candidate eight pass. This unchanged regression was not rerun for the equality addition.
  • Equality addition at c8da512 (production blob 0bcc35d121c9dcdbc11b27d1b92f7d148cf0e85f): complete StringUtil plus four unchanged official support classes and real Spring Core5.2.10.RELEASE. Baseline six assertion failures and eight controls; candidate fourteen pass. Assertions cover builders, buffers, mixed String/CharSequence and both overloads; controls retain unequal/case/identity/null behavior.
  • JDK25 javac --release8 and runtime25, CPU1/aggregate768MiB/16processes/privateTMP/BLAS1. Equality job peak313683968 bytes. No installed dependencies, stubs or copied function bodies. --release8 is not Java8 runtime testing.
  • Full Maven/Spring service, Java8 runtime and whole repository NOT_RUN. Earlier eight-pass evidence and new fourteen-pass evidence are separate runs, not a new combined22 pass claim. No affected controller endpoint is asserted; this is the documented public utility API.

Run focused equality test: compile the complete class, its four official support classes and tests/StringUtilCharSequenceEqualsRegression.java against the existing Spring Core5.2.10.RELEASE, then run that class. Existing tests/StringUtilReverseSearchRegression.java remains unchanged.

Assisted-by: OpenAI gpt-6.1-sol

Check index zero in the reverse-search loop so an otherwise matching
prefix is not missed. Preserve the existing starting-index and empty-input
handling and add standalone regressions against the complete StringUtil.

Signed-off-by: Hanabi <317387557+Hanabi9248@users.noreply.github.com>
Keep the existing reverse-search correction and null/case policies while
comparing builder, buffer and String operands by textual contents.

Signed-off-by: Hanabi <317387557+Hanabi9248@users.noreply.github.com>
Assisted-by: OpenAI gpt-6.1-sol
@Hanabi9248 Hanabi9248 changed the title fix: include index zero in reverse case-insensitive search fix(toolkit): correct reverse-search boundary and CharSequence equality Oct 26, 2026
@Hanabi9248
Hanabi9248 force-pushed the codex/reverse-search-zero-index branch 2 times, most recently from 90938c8 to c8da512 Compare October 30, 2026 15:44
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