Skip to content

Commit

Permalink
fix some spotbugs
Browse files Browse the repository at this point in the history
  • Loading branch information
myandpr committed Nov 11, 2024
1 parent a97e32c commit dd564ee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ public byte[] getXAttr(Path f, String name) throws IOException {
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);
}

/** Convert xAttrs json to xAttrs map */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1085,15 +1085,9 @@ public DatanodeInfo[] getDatanodeReport(DatanodeReportType type)
* @throws IOException If it cannot get the report.
*/
DatanodeInfo[] getCachedDatanodeReport(DatanodeReportType type)
throws IOException {
throws IOException {
try {
DatanodeInfo[] dns = this.dnCache.get(type);
if (dns == null) {
LOG.debug("Get null DN report from cache");
dns = getCachedDatanodeReportImpl(type);
this.dnCache.put(type, dns);
}
return dns;
return this.dnCache.get(type);
} catch (ExecutionException e) {
LOG.error("Cannot get the DN report for {}", type, e);
Throwable cause = e.getCause();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,9 @@
</Or>
<Bug pattern="SE_BAD_FIELD" />
</Match>
<Match>
<Class name="org.apache.hadoop.yarn.service.ServiceScheduler$1"/>
<Method name="load"/>
<Bug code="NP" pattern="NP_NONNULL_RETURN_VIOLATION"/>
</Match>
</FindBugsFilter>

0 comments on commit dd564ee

Please sign in to comment.