HBASE-18268 Eliminate the findbugs warnings for hbase-client

Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/cc4301ca
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/cc4301ca
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/cc4301ca

Branch: refs/heads/HBASE-14070.HLC
Commit: cc4301ca0842d9c3f66dfa39c5627744f5f91a8c
Parents: d215cb4
Author: Chia-Ping Tsai <chia7...@gmail.com>
Authored: Tue Jun 27 10:17:41 2017 +0800
Committer: Chia-Ping Tsai <chia7...@gmail.com>
Committed: Wed Jul 12 03:07:17 2017 +0800

----------------------------------------------------------------------
 .../hadoop/hbase/client/ColumnFamilyDescriptorBuilder.java      | 5 +++--
 .../java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java     | 2 ++
 .../org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java   | 1 -
 .../src/main/java/org/apache/hadoop/hbase/util/PoolMap.java     | 2 +-
 4 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/cc4301ca/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.java
----------------------------------------------------------------------
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.java
index bb302db..20706c6 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.java
@@ -1091,12 +1091,13 @@ public class ColumnFamilyDescriptorBuilder {
         s.append(HConstants.METADATA).append(" => ");
         s.append('{');
         boolean printComma = false;
-        for (Bytes k : values.keySet()) {
+        for (Map.Entry<Bytes, Bytes> entry : values.entrySet()) {
+          Bytes k = entry.getKey();
           if (RESERVED_KEYWORDS.contains(k)) {
             continue;
           }
           String key = Bytes.toString(k.get());
-          String value = Bytes.toStringBinary(values.get(k).get());
+          String value = Bytes.toStringBinary(entry.getValue().get());
           if (printComma) {
             s.append(", ");
           }

http://git-wip-us.apache.org/repos/asf/hbase/blob/cc4301ca/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java
----------------------------------------------------------------------
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java
index d414f70..2acddda 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java
@@ -101,6 +101,8 @@ public abstract class AbstractRpcClient<T extends 
RpcConnection> implements RpcC
   private static final ScheduledExecutorService IDLE_CONN_SWEEPER = Executors
       .newScheduledThreadPool(1, 
Threads.newDaemonThreadFactory("Idle-Rpc-Conn-Sweeper"));
 
+  
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="MS_MUTABLE_COLLECTION_PKGPROTECT",
+      justification="the rest of the system which live in the different 
package can use")
   protected final static Map<Kind, TokenSelector<? extends TokenIdentifier>> 
TOKEN_HANDLERS = new HashMap<>();
 
   static {

http://git-wip-us.apache.org/repos/asf/hbase/blob/cc4301ca/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java
----------------------------------------------------------------------
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java
index eebe4bd..b1b52b1 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java
@@ -3211,7 +3211,6 @@ public final class ProtobufUtil {
       for (ServerName serverName : status.getServers()) {
         LiveServerInfo.Builder lsi =
             
LiveServerInfo.newBuilder().setServer(ProtobufUtil.toServerName(serverName));
-        status.getLoad(serverName);
         lsi.setServerLoad(status.getLoad(serverName).obtainServerLoadPB());
         builder.addLiveServers(lsi.build());
       }

http://git-wip-us.apache.org/repos/asf/hbase/blob/cc4301ca/hbase-client/src/main/java/org/apache/hadoop/hbase/util/PoolMap.java
----------------------------------------------------------------------
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/util/PoolMap.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/util/PoolMap.java
index 2131db3..40c6b55 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/util/PoolMap.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/util/PoolMap.java
@@ -210,7 +210,7 @@ public class PoolMap<K, V> implements Map<K, V> {
         }
       }
     }
-    return null;
+    return entries;
   }
 
   protected interface Pool<R> {

Reply via email to