You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@empire-db.apache.org by "codingkiddo (via GitHub)" <gi...@apache.org> on 2026/05/07 14:22:41 UTC
[PR] Fix StringUtils.lastIndexOfAny start index [empire-db]
codingkiddo opened a new pull request, #20:
URL: https://github.com/apache/empire-db/pull/20
### Summary
Fixes an off-by-one error in `StringUtils.lastIndexOfAny`.
The method currently starts reverse iteration from `value.length()`, but the last valid character index is `value.length() - 1`. For non-empty strings, this can cause `StringIndexOutOfBoundsException` when `value.charAt(i)` is called.
### Changes
- Start reverse iteration from `value.length() - 1`
- Add unit tests for:
- matching the last character
- matching an earlier character
- no match
- empty string
- null input
### Jira
I have requested access to Apache Jira, but the account approval is still pending. I am raising this PR first because the fix is small and straightforward.
Once my Jira account is approved, I can create/link the corresponding EMPIREDB Jira issue if required.
### Verification
```bash
mvn -pl empire-db -Dtest=StringUtilsTest test
mvn -pl empire-db test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@empire-db.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
re: [PR] Fix StringUtils.lastIndexOfAny start index [empire-db]
Posted by Rainer Döbele <do...@esteam.de>.
Dear codingkiddo,
thanks for your bugfix.
I have reviewed your pull request and merged it with the master.
Also I have created a jira ticket.
https://issues.apache.org/jira/browse/EMPIREDB-489
We appreciate your contribution.
Best regards,
Rainer
-----Original message -----
from: codingkiddo (via GitHub) <gi...@apache.org>
sent: Donnerstag, 7. Mai 2026 16:23
to: dev@empire-db.apache.org
subject: [PR] Fix StringUtils.lastIndexOfAny start index [empire-db]
codingkiddo opened a new pull request, #20:
URL: https://github.com/apache/empire-db/pull/20
### Summary
Fixes an off-by-one error in `StringUtils.lastIndexOfAny`.
The method currently starts reverse iteration from `value.length()`, but the last valid character index is `value.length() - 1`. For non-empty strings, this can cause `StringIndexOutOfBoundsException` when `value.charAt(i)` is called.
### Changes
- Start reverse iteration from `value.length() - 1`
- Add unit tests for:
- matching the last character
- matching an earlier character
- no match
- empty string
- null input
### Jira
I have requested access to Apache Jira, but the account approval is still pending. I am raising this PR first because the fix is small and straightforward.
Once my Jira account is approved, I can create/link the corresponding EMPIREDB Jira issue if required.
### Verification
```bash
mvn -pl empire-db -Dtest=StringUtilsTest test
mvn -pl empire-db test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@empire-db.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix StringUtils.lastIndexOfAny start index [empire-db]
Posted by "asf-gitbox-commits (via GitHub)" <gi...@apache.org>.
asf-gitbox-commits merged PR #20:
URL: https://github.com/apache/empire-db/pull/20
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@empire-db.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org