danny0405 commented on code in PR #18234:
URL: https://github.com/apache/hudi/pull/18234#discussion_r2838965021
##########
hudi-common/src/main/java/org/apache/hudi/HoodieVersion.java:
##########
@@ -81,11 +81,14 @@ private static String getVersion(int allowedDotCount) {
}
private static String getSubVersion(String version, int allowedDotCount) {
+ int index = version.indexOf('.');
if (allowedDotCount == 1) {
- int index = version.indexOf('.');
return index == -1 ? version : version.substring(0, index);
}
- return getSubVersion(version.substring(version.indexOf('.') + 1),
allowedDotCount - 1);
+ if (index == -1) {
+ return version;
+ }
+ return getSubVersion(version.substring(index + 1), allowedDotCount - 1);
Review Comment:
the `String.substring(` already specially handled the scanario with start
index `0` (returns the string by itself.)
--
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]