Skip to content

Conversation

@inponomarev
Copy link
Contributor

This PR fixes TEXT-239 by correcting the exception message in
TextStringBuilder.append(char[], int, int) when startIndex is invalid.

A regression test is included to verify both invalid length and invalid startIndex cases report the correct variable.

⚠️ The same issue exists in deprecated StrBuilder implementations (commons-text / commons-lang). This PR intentionally limits the change to TextStringBuilder

Copy link
Member

@garydgregory garydgregory left a comment

Choose a reason for hiding this comment

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

Hello @inponomarev

Thank you for this PR.

If the same error exists elsewhere, please fix it in this PR as well.

Note that I updated the master branch's Checkstyle rules to catch missing finals for locals.

@inponomarev
Copy link
Contributor Author

Hi @garydgregory , thank you for reviewing this.
I added the fix+regression test for the deprecated StrBuilder, rebased my branch and made sure Checkstyle is happy

@garydgregory garydgregory merged commit a3e4306 into apache:master Jan 28, 2026
9 checks passed
garydgregory added a commit that referenced this pull request Jan 28, 2026
variable in exception message #735

Use longer lines
Keep test methods in AB order
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.

2 participants