smengcl commented on code in PR #4042:
URL: https://github.com/apache/ozone/pull/4042#discussion_r1054810045


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/handlers/LegacyBucketHandler.java:
##########
@@ -322,4 +323,11 @@ public Table<String, OmKeyInfo> getKeyTable() {
         getOmMetadataManager().getKeyTable(getBucketLayout());
     return keyTable;
   }
+
+  @Override
+  public OmDirectoryInfo getDirInfo(String[] names) throws IOException {
+    return OmDirectoryInfo.newBuilder()
+        .setName(names[2])

Review Comment:
   If `names` has less than 3 elements, iirc it throws 
`ArrayIndexOutOfBoundsException` which is a `RuntimeException` and won't be 
caught by `IOException`.
   
   Add a `Preconditions.checkArgument` check here?



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