From 6ccb223c9c98a448bdb46acfddeb0b351d5b196a Mon Sep 17 00:00:00 2001 From: huhaiyang Date: Fri, 12 Apr 2024 19:53:25 +0800 Subject: [PATCH] HDFS-17461. Fix spotbugs in PeerCache#getInternal (#6721). Contributed by Haiyang Hu. Reviewed-by: ZanderXu Reviewed-by: Ayush Saxena Signed-off-by: He Xiaoqiao --- .../src/main/java/org/apache/hadoop/hdfs/PeerCache.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/PeerCache.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/PeerCache.java index a26a518a83..41578d4d50 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/PeerCache.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/PeerCache.java @@ -155,10 +155,6 @@ public Peer get(DatanodeID dnId, boolean isDomain) { private synchronized Peer getInternal(DatanodeID dnId, boolean isDomain) { List sockStreamList = multimap.get(new Key(dnId, isDomain)); - if (sockStreamList == null) { - return null; - } - Iterator iter = sockStreamList.iterator(); while (iter.hasNext()) { Value candidate = iter.next();