hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject git commit: HBASE-11413 [findbugs] RV: Negating the result of compareTo()/compare() (Mike Drob)
Date Wed, 02 Jul 2014 17:08:15 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 c8d1d7cef -> 1b2a05c94


HBASE-11413 [findbugs] RV: Negating the result of compareTo()/compare() (Mike Drob)


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

Branch: refs/heads/0.98
Commit: 1b2a05c9446cab8e616f6988ea6d176043fd8e57
Parents: c8d1d7c
Author: stack <stack@apache.org>
Authored: Wed Jul 2 10:07:16 2014 -0700
Committer: stack <stack@apache.org>
Committed: Wed Jul 2 10:07:16 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/master/CatalogJanitor.java    | 6 +++---
 .../org/apache/hadoop/hbase/migration/NamespaceUpgrade.java    | 2 +-
 .../java/org/apache/hadoop/hbase/util/FSTableDescriptors.java  | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/1b2a05c9/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java
index 59bc01e..1ffec8a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java
@@ -294,10 +294,10 @@ public class CatalogJanitor extends Chore {
       // Compare start keys.
       result = Bytes.compareTo(left.getStartKey(), right.getStartKey());
       if (result != 0) return result;
-      // Compare end keys.
-      result = rowEndKeyComparator.compare(left.getEndKey(), right.getEndKey());
+      // Compare end keys, but flip the operands so parent comes first
+      result = rowEndKeyComparator.compare(right.getEndKey(), left.getEndKey());
 
-      return -result; // Flip the result so parent comes first.
+      return result;
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/1b2a05c9/hbase-server/src/main/java/org/apache/hadoop/hbase/migration/NamespaceUpgrade.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/migration/NamespaceUpgrade.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/migration/NamespaceUpgrade.java
index b054813..daef083 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/migration/NamespaceUpgrade.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/migration/NamespaceUpgrade.java
@@ -524,7 +524,7 @@ public class NamespaceUpgrade implements Tool {
   new Comparator<FileStatus>() {
     @Override
     public int compare(FileStatus left, FileStatus right) {
-      return -left.compareTo(right);
+      return right.compareTo(left);
     }};
 
   // logic culled from FSTableDescriptors

http://git-wip-us.apache.org/repos/asf/hbase/blob/1b2a05c9/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
index f3f2968..09749d0 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
@@ -378,7 +378,7 @@ public class FSTableDescriptors implements TableDescriptors {
   new Comparator<FileStatus>() {
     @Override
     public int compare(FileStatus left, FileStatus right) {
-      return -left.compareTo(right);
+      return right.compareTo(left);
     }};
 
   /**


Mime
View raw message