You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ju...@apache.org on 2017/08/02 00:12:57 UTC
hadoop git commit: HADOOP-14683. FileStatus.compareTo binary
compatible issue. Contributed by Akira Ajisaka.
Repository: hadoop
Updated Branches:
refs/heads/trunk 52d7bafcf -> cf6794ebe
HADOOP-14683. FileStatus.compareTo binary compatible issue. Contributed by Akira Ajisaka.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/cf6794eb
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/cf6794eb
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/cf6794eb
Branch: refs/heads/trunk
Commit: cf6794ebe93906c406a54acc5c8854dc600a9a7f
Parents: 52d7baf
Author: Junping Du <ju...@apache.org>
Authored: Tue Aug 1 17:13:02 2017 -0700
Committer: Junping Du <ju...@apache.org>
Committed: Tue Aug 1 17:13:02 2017 -0700
----------------------------------------------------------------------
.../java/org/apache/hadoop/fs/FileStatus.java | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/cf6794eb/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
index f5111ef..7ce6363 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
@@ -34,7 +34,7 @@ import org.apache.hadoop.io.Writable;
*/
@InterfaceAudience.Public
@InterfaceStability.Stable
-public class FileStatus implements Writable, Comparable<FileStatus>,
+public class FileStatus implements Writable, Comparable<Object>,
Serializable, ObjectInputValidation {
private static final long serialVersionUID = 0x13caeae8;
@@ -352,11 +352,25 @@ public class FileStatus implements Writable, Comparable<FileStatus>,
* @return a negative integer, zero, or a positive integer as this object
* is less than, equal to, or greater than the specified object.
*/
- @Override
public int compareTo(FileStatus o) {
return this.getPath().compareTo(o.getPath());
}
-
+
+ /**
+ * Compare this FileStatus to another FileStatus.
+ * This method was added back by HADOOP-14683 to keep binary compatibility.
+ *
+ * @param o the FileStatus to be compared.
+ * @return a negative integer, zero, or a positive integer as this object
+ * is less than, equal to, or greater than the specified object.
+ * @throws ClassCastException if the specified object is not FileStatus
+ */
+ @Override
+ public int compareTo(Object o) {
+ FileStatus other = (FileStatus) o;
+ return compareTo(other);
+ }
+
/** Compare if this object is equal to another object
* @param o the object to be compared.
* @return true if two file status has the same path name; false if not.
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org