danny0405 commented on code in PR #18235:
URL: https://github.com/apache/hudi/pull/18235#discussion_r2838917674
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/rollback/ListingBasedRollbackStrategy.java:
##########
@@ -289,7 +289,8 @@ private List<HoodieRollbackRequest>
getHoodieRollbackRequests(String partitionPa
private static String formatDeletePath(String path) {
// strip scheme E.g: file:/var/folders
- return path.substring(path.indexOf(":") + 1);
+ int colonIndex = path.indexOf(":");
+ return colonIndex == -1 ? path : path.substring(colonIndex + 1);
Review Comment:
the impl already did the short-cut logic:
```java
public String substring(int beginIndex) {
if (beginIndex < 0) {
throw new StringIndexOutOfBoundsException(beginIndex);
}
int subLen = value.length - beginIndex;
if (subLen < 0) {
throw new StringIndexOutOfBoundsException(subLen);
}
return (beginIndex == 0) ? this : new String(value, beginIndex,
subLen);
}
```
--
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]