You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/10/13 16:07:18 UTC

[GitHub] [ozone] dombizita commented on a change in pull request #2735: HDDS-5826 [HTTPFSGW] Remove or replace Hadoop shaded guava dependencies.

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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org