浏览代码

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

(cherry picked from commit 12ecb55ffee2b89108eea2565e7ad955ea1fabe7)

Steve Loughran 7 年之前
父节点
当前提交
a5cb7f3616

+ 1 - 1
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java

@@ -458,7 +458,7 @@ public class FileStatus implements Writable, Comparable<Object>,
     setSymlink((other.isSymlink() ? other.getSymlink() : null));
     setSymlink((other.isSymlink() ? other.getSymlink() : null));
     setPath(other.getPath());
     setPath(other.getPath());
     attr = flags(other.hasAcl(), other.isEncrypted(), other.isErasureCoded());
     attr = flags(other.hasAcl(), other.isEncrypted(), other.isErasureCoded());
-    assert (isDirectory() && getSymlink() == null) || !isDirectory();
+    assert !(isDirectory() && isSymlink()) : "A directory cannot be a symlink";
   }
   }
 
 
   /**
   /**