HBASE-11413 [findbugs] RV: Negating the result of compareTo()/compare() (Mike Drob)
This commit is contained in:
parent
7a2527da4b
commit
9ff90931dc
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue