HDFS-10396. Using -diff option with DistCp may get "Comparison method violates its general contract" exception. Contributed by Yongjun Zhang.
(cherry picked from commit 8113855b3a
)
This commit is contained in:
parent
7595d89612
commit
81f0d56c57
|
@ -41,8 +41,8 @@ class DiffInfo {
|
|||
static final Comparator<DiffInfo> targetComparator = new Comparator<DiffInfo>() {
|
||||
@Override
|
||||
public int compare(DiffInfo d1, DiffInfo d2) {
|
||||
return d1.target == null ? -1 :
|
||||
(d2.target == null ? 1 : d1.target.compareTo(d2.target));
|
||||
return d1.target == null ? ((d2.target == null)? 0 : -1) :
|
||||
(d2.target == null ? 1 : d1.target.compareTo(d2.target));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue