dombizita commented on a change in pull request #2735:
URL: https://github.com/apache/ozone/pull/2735#discussion_r728225868



##########
File path: 
hadoop-ozone/httpfsgateway/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java
##########
@@ -1402,13 +1399,13 @@ public void setXAttr(Path f, String name, byte[] value,
     JSONObject json = (JSONObject) HttpFSUtils.jsonParse(conn);
     Map<String, byte[]> xAttrs = createXAttrMap(
         (JSONArray) json.get(XATTRS_JSON));
-    return xAttrs != null ? xAttrs.get(name) : null;
+    return xAttrs.get(name);

Review comment:
       My previous PR failed because the missing of this change, the findbug 
error was: "Redundant nullcheck of xAttrs, which is known to be non-null in 
org.apache.hadoop.fs.http.client.HttpFSFileSystem.getXAttr(Path, String) 
Redundant null check at HttpFSFileSystem.java:[line 1402]". 
   xAttrs is created in the line before with the createXAttrMap() method, which 
I changed in this PR, because it used Maps.newHashMap() to create xAttrs and I 
replaced it with a HashMap constructor call. Because of this change the null 
check is not neccessary, as the method couldn't return 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