hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yjzhan...@apache.org
Subject hadoop git commit: HDFS-10396. Using -diff option with DistCp may get "Comparison method violates its general contract" exception. Contributed by Yongjun Zhang.
Date Wed, 29 Jun 2016 06:44:39 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 f44d7782f -> 4a57c03f3


HDFS-10396. Using -diff option with DistCp may get "Comparison method violates its general
contract" exception. Contributed by Yongjun Zhang.

(cherry picked from commit 8113855b3af913e6dcd09626953c64d43168efbd)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/4a57c03f
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/4a57c03f
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/4a57c03f

Branch: refs/heads/branch-2.8
Commit: 4a57c03f30b8e0da50403b7d5be602833f4e2d0a
Parents: f44d778
Author: Yongjun Zhang <yzhang@cloudera.com>
Authored: Tue Jun 28 23:15:13 2016 -0700
Committer: Yongjun Zhang <yzhang@cloudera.com>
Committed: Tue Jun 28 23:34:44 2016 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/tools/DiffInfo.java          | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/4a57c03f/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DiffInfo.java
----------------------------------------------------------------------
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 10a8b7e..79bb7fe 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<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));
     }
   };
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message