HDFS-17637. Fix spotbugs in HttpFSFileSystem#getXAttr (#7099) Contributed by Hualong Zhang.

Reviewed-by: Shilun Fan <slfan1989@apache.org>
Signed-off-by: Shilun Fan <slfan1989@apache.org>
This commit is contained in:
zhtttylz 2024-10-06 09:16:00 +08:00 committed by GitHub
parent 5ea3a1bd0a
commit 1f0d9df887
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1370,7 +1370,7 @@ public byte[] getXAttr(Path f, String name) throws IOException {
JSONObject json = (JSONObject) HttpFSUtils.jsonParse(conn); JSONObject json = (JSONObject) HttpFSUtils.jsonParse(conn);
Map<String, byte[]> xAttrs = createXAttrMap( Map<String, byte[]> xAttrs = createXAttrMap(
(JSONArray) json.get(XATTRS_JSON)); (JSONArray) json.get(XATTRS_JSON));
return xAttrs != null ? xAttrs.get(name) : null; return xAttrs.get(name);
} }
/** Convert xAttrs json to xAttrs map */ /** Convert xAttrs json to xAttrs map */