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) <[email protected]> sent: Donnerstag, 7. Mai 2026 16:23 to: [email protected] 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
