F64116045 commented on code in PR #10980:
URL: https://github.com/apache/ozone/pull/10980#discussion_r3745888267


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3LifecycleConfiguration.java:
##########
@@ -312,13 +312,17 @@ public OmLifecycleConfiguration 
toOmLifecycleConfiguration(OzoneBucket ozoneBuck
    * @return OmLCRule internal rule representation
    */
   private OmLCRule convertToOmRule(Rule rule) throws OMException, OS3Exception 
{
-    if (rule.getStatus() == null || rule.getStatus().isEmpty()) {
+    String status = rule.getStatus();
+    if (status == null || status.isEmpty()) {
       throw S3ErrorTable.newError(S3ErrorTable.MALFORMED_XML,
           "The Status element is required in LifecycleConfiguration");

Review Comment:
   The second String argument here is actually 
[resource](https://github.com/apache/ozone/blob/3b8c05e635e8a03fe9c232853220f295e8ac701b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/exception/S3ErrorTable.java#L266-L269),
 and OS3Exception serializes it as 
[`<Resource>`](https://github.com/apache/ozone/blob/3b8c05e635e8a03fe9c232853220f295e8ac701b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/exception/OS3Exception.java#L69-L75).
 So this text does not replace `<Message>`; 
[MALFORMED_XML](https://github.com/apache/ozone/blob/3b8c05e635e8a03fe9c232853220f295e8ac701b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/exception/S3ErrorTable.java#L147-L149)
 already provides that. I think the one-argument overload is enough here.
   
   This is in the existing missing-Status path, so I plan to follow it up 
separately with response coverage. If it makes more sense to include it here, I 
can update the patch.



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