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-18365 Eliminate the findbugs warnings for hbase-common
Date Thu, 13 Jul 2017 11:32:30 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 22df92654 -> cf636e50b


HBASE-18365 Eliminate the findbugs warnings for hbase-common


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

Branch: refs/heads/master
Commit: cf636e50b9d2afbf0d017f2463b510ec10653a1a
Parents: 22df926
Author: Chia-Ping Tsai <chia7712@gmail.com>
Authored: Thu Jul 13 19:31:59 2017 +0800
Committer: Chia-Ping Tsai <chia7712@gmail.com>
Committed: Thu Jul 13 19:31:59 2017 +0800

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/util/DynamicClassLoader.java   | 5 +++--
 .../main/java/org/apache/hadoop/hbase/util/OrderedBytes.java    | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/cf636e50/hbase-common/src/main/java/org/apache/hadoop/hbase/util/DynamicClassLoader.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/DynamicClassLoader.java
b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/DynamicClassLoader.java
index 1a73069..a805fbf 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/DynamicClassLoader.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/DynamicClassLoader.java
@@ -179,8 +179,9 @@ public class DynamicClassLoader extends ClassLoaderBase {
 
   private synchronized void loadNewJars() {
     // Refresh local jar file lists
-    if (localDir != null) {
-      for (File file : localDir.listFiles()) {
+    File[] files = localDir == null ? null : localDir.listFiles();
+    if (files != null) {
+      for (File file : files) {
         String fileName = file.getName();
         if (jarModifiedTime.containsKey(fileName)) {
           continue;

http://git-wip-us.apache.org/repos/asf/hbase/blob/cf636e50/hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java
index 3e4bc6c..7ba17f9 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java
@@ -461,7 +461,7 @@ public class OrderedBytes {
   static int lengthVaruint64(PositionedByteRange src, boolean comp) {
     int a0 = (comp ? DESCENDING : ASCENDING).apply(src.peek()) & 0xff;
     if (a0 <= 240) return 1;
-    if (a0 >= 241 && a0 <= 248) return 2;
+    if (a0 <= 248) return 2;
     if (a0 == 249) return 3;
     if (a0 == 250) return 4;
     if (a0 == 251) return 5;


Mime
View raw message