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 10, 2024
1 parent a97e32c commit 7a3d6ed
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 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 @@ -1087,13 +1087,7 @@ public DatanodeInfo[] getDatanodeReport(DatanodeReportType type)
DatanodeInfo[] getCachedDatanodeReport(DatanodeReportType type)
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 @@ -725,4 +725,11 @@
<Match>
<Package name="org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.placement.schema" />
</Match>

<!-- Ignore spotbugs about NP_NONNULL_RETURN_VIOLATION in org.apache.hadoop.yarn.service.ServiceScheduler$1.load(ConfigFile) -->
<Match>
<Class name="org.apache.hadoop.yarn.service.ServiceScheduler"/>
<Method name="$1.load(ConfigFile)" />
<Bug pattern="NP_NONNULL_RETURN_VIOLATION"/>
</Match>
</FindBugsFilter>
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.Nonnull;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.URI;
Expand Down

0 comments on commit 7a3d6ed

Please sign in to comment.