From 12ecb55ffee2b89108eea2565e7ad955ea1fabe7 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Tue, 6 Mar 2018 10:05:12 +0000 Subject: [PATCH] HADOOP-15289. FileStatus.readFields() assertion incorrect. Contributed by Steve Loughran. --- .../src/main/java/org/apache/hadoop/fs/FileStatus.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 0663c43d182..83910c46c10 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, 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"; } /**