rdblue commented on code in PR #4946:
URL: https://github.com/apache/iceberg/pull/4946#discussion_r890376535


##########
core/src/main/java/org/apache/iceberg/BaseMetastoreTableOperations.java:
##########
@@ -336,7 +336,10 @@ private static int parseVersion(String metadataLocation) {
     int versionEnd = metadataLocation.indexOf('-', versionStart);
     try {
       return Integer.valueOf(metadataLocation.substring(versionStart, 
versionEnd));
-    } catch (NumberFormatException e) {
+    } catch (NumberFormatException | StringIndexOutOfBoundsException e) {

Review Comment:
   Why not check `versionEnd`? If `versionEnd` is < 0, then return -1. No need 
to catch an exception.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to