Skip to content

Commit dd68d87

Browse files
author
yanmin
committed
fix spotbugs
1 parent 652d92f commit dd68d87

File tree

3 files changed

+8
-9
lines changed
  • hadoop-hdfs-project
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/dev-support

3 files changed

+8
-9
lines changed

hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,7 @@ public byte[] getXAttr(Path f, String name) throws IOException {
13701370
JSONObject json = (JSONObject) HttpFSUtils.jsonParse(conn);
13711371
Map<String, byte[]> xAttrs = createXAttrMap(
13721372
(JSONArray) json.get(XATTRS_JSON));
1373-
return xAttrs != null ? xAttrs.get(name) : null;
1373+
return xAttrs.get(name);
13741374
}
13751375

13761376
/** Convert xAttrs json to xAttrs map */

hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,13 +1087,7 @@ public DatanodeInfo[] getDatanodeReport(DatanodeReportType type)
10871087
DatanodeInfo[] getCachedDatanodeReport(DatanodeReportType type)
10881088
throws IOException {
10891089
try {
1090-
DatanodeInfo[] dns = this.dnCache.get(type);
1091-
if (dns == null) {
1092-
LOG.debug("Get null DN report from cache");
1093-
dns = getCachedDatanodeReportImpl(type);
1094-
this.dnCache.put(type, dns);
1095-
}
1096-
return dns;
1090+
return this.dnCache.get(type);
10971091
} catch (ExecutionException e) {
10981092
LOG.error("Cannot get the DN report for {}", type, e);
10991093
Throwable cause = e.getCause();

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/dev-support/findbugs-exclude.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,10 @@
5555
<Field name="additional"/>
5656
</Or>
5757
<Bug pattern="SE_BAD_FIELD" />
58-
</Match>
58+
</Match>
59+
<Match>
60+
<Class name="org.apache.hadoop.yarn.service.ServiceScheduler$1"/>
61+
<Method name="load"/>
62+
<Bug code="NP" pattern="NP_NONNULL_RETURN_VIOLATION"/>
63+
</Match>
5964
</FindBugsFilter>

0 commit comments

Comments
 (0)