HADOOP-15289. FileStatus.readFields() assertion incorrect.
Contributed by Steve Loughran.


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

Branch: refs/heads/HDFS-7240
Commit: 12ecb55ffee2b89108eea2565e7ad955ea1fabe7
Parents: 55ba49d
Author: Steve Loughran <ste...@apache.org>
Authored: Tue Mar 6 10:05:12 2018 +0000
Committer: Steve Loughran <ste...@apache.org>
Committed: Tue Mar 6 10:05:12 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/12ecb55f/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: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to