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:36:31 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.4 5da7273db -> 0616811fa


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

Branch: refs/heads/branch-1.4
Commit: 0616811fab759ef6cd32421e149422291c88c9f0
Parents: 5da7273
Author: Chia-Ping Tsai <chia7712@gmail.com>
Authored: Thu Jul 13 19:35:57 2017 +0800
Committer: Chia-Ping Tsai <chia7712@gmail.com>
Committed: Thu Jul 13 19:35:57 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/0616811f/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 e6fe691..07ca348 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/0616811f/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 a0c7390..9a40aee 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
@@ -463,7 +463,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