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:
Yongjun Zhang 2016-06-28 23:15:13 -07:00
parent f44d7782f6
commit 4a57c03f30
1 changed files with 2 additions and 2 deletions

View File

@ -38,7 +38,7 @@ public int compare(DiffInfo d1, DiffInfo d2) {
static final Comparator<DiffInfo> targetComparator = new Comparator<DiffInfo>() {
@Override
public int compare(DiffInfo d1, DiffInfo d2) {
return d1.target == null ? -1 :
return d1.target == null ? ((d2.target == null)? 0 : -1) :
(d2.target == null ? 1 : d1.target.compareTo(d2.target));
}
};