hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chia7...@apache.org
Subject hbase git commit: HBASE-18268 Eliminate the findbugs warnings for hbase-client
Date Tue, 11 Jul 2017 19:14:45 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-2 4c699fd82 -> ca5d8c40b


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/ca5d8c40
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/ca5d8c40
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/ca5d8c40

Branch: refs/heads/branch-2
Commit: ca5d8c40b7e39260f919cb6205acc2a875a1f118
Parents: 4c699fd
Author: Chia-Ping Tsai <chia7712@gmail.com>
Authored: Tue Jun 27 10:17:41 2017 +0800
Committer: Chia-Ping Tsai <chia7712@gmail.com>
Committed: Wed Jul 12 03:08:05 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/ca5d8c40/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/ca5d8c40/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/ca5d8c40/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/ca5d8c40/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> {


Mime
View raw message