HADOOP-15289. FileStatus.readFields() assertion incorrect. Contributed by Steve Loughran.
(cherry picked from commit 12ecb55ffee2b89108eea2565e7ad955ea1fabe7) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e8ecd4fa Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e8ecd4fa Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e8ecd4fa Branch: refs/heads/branch-3.1 Commit: e8ecd4fa1df50fb66167bc707340e06f0efc4ac3 Parents: 429e9d6 Author: Steve Loughran <[email protected]> Authored: Tue Mar 6 10:06:11 2018 +0000 Committer: Steve Loughran <[email protected]> Committed: Tue Mar 6 10:06:11 2018 +0000 ---------------------------------------------------------------------- .../src/main/java/org/apache/hadoop/fs/FileStatus.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/e8ecd4fa/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 0663c43..83910c4 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 @@ -502,7 +502,7 @@ public class FileStatus implements Writable, Comparable<Object>, setPath(other.getPath()); attr = attributes(other.hasAcl(), other.isEncrypted(), other.isErasureCoded(), other.isSnapshotEnabled()); - assert (isDirectory() && getSymlink() == null) || !isDirectory(); + assert !(isDirectory() && isSymlink()) : "A directory cannot be a symlink"; } /** --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
