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:35:51 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 e1bf966f9 -> 1b8fb0a8d


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

Branch: refs/heads/branch-1
Commit: 1b8fb0a8d871732536c711c5229c1dfc2b47fde9
Parents: e1bf966
Author: Chia-Ping Tsai <chia7712@gmail.com>
Authored: Thu Jul 13 19:35:18 2017 +0800
Committer: Chia-Ping Tsai <chia7712@gmail.com>
Committed: Thu Jul 13 19:35:18 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/1b8fb0a8/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/1b8fb0a8/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