diff --git a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DiffInfo.java b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DiffInfo.java index 10a8b7e25c2..79bb7fe2671 100644 --- a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DiffInfo.java +++ b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DiffInfo.java @@ -38,8 +38,8 @@ class DiffInfo { static final Comparator targetComparator = new Comparator() { @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)); } };