YutaLin commented on code in PR #9688:
URL: https://github.com/apache/ozone/pull/9688#discussion_r2791433321


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/lifecycle/OMLifecycleConfigurationSetRequest.java:
##########
@@ -148,9 +148,16 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager, Execut
       OmLifecycleConfiguration.Builder lcBuilder =
           
OmLifecycleConfiguration.getBuilderFromProtobuf(lifecycleConfiguration);
       lcBuilder.setUpdateID(transactionLogIndex);
-      OmLifecycleConfiguration omLifecycleConfiguration =
-          lcBuilder.setBucketObjectID(bucketInfo.getObjectID()).build();
-      omLifecycleConfiguration.valid();
+      OmLifecycleConfiguration omLifecycleConfiguration;
+      try {
+        omLifecycleConfiguration =
+            lcBuilder.setBucketObjectID(bucketInfo.getObjectID()).build();
+      } catch (IllegalArgumentException e) {
+        if (e.getCause() instanceof OMException) {

Review Comment:
   Hi @ChenSammi, do we need null check here? I think `instanceof` is null-safe 
and will just return false if the left side is null.



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