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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]