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 om...@apache.org on 2011/03/08 05:38:03 UTC
svn commit: r1079130 - in /hadoop/common/branches/yahoo-merge: CHANGES.txt
src/java/org/apache/hadoop/fs/FileStatus.java
Author: omalley
Date: Tue Mar 8 04:38:02 2011
New Revision: 1079130
URL: http://svn.apache.org/viewvc?rev=1079130&view=rev
Log:
commit d6e31875ab8888814e3776038943c0cade74b912
Author: Eli Collins <el...@apache.org>
Date: Mon Nov 15 05:05:42 2010 +0000
HADOOP-7032. Assert type constraints in the FileStatus constructor. Contributed by Eli Collins
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1035147 13f79535-47bb-0310-9956-ffa450edef68
Modified:
hadoop/common/branches/yahoo-merge/CHANGES.txt
hadoop/common/branches/yahoo-merge/src/java/org/apache/hadoop/fs/FileStatus.java
Modified: hadoop/common/branches/yahoo-merge/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/yahoo-merge/CHANGES.txt?rev=1079130&r1=1079129&r2=1079130&view=diff
==============================================================================
--- hadoop/common/branches/yahoo-merge/CHANGES.txt (original)
+++ hadoop/common/branches/yahoo-merge/CHANGES.txt Tue Mar 8 04:38:02 2011
@@ -180,6 +180,8 @@ Trunk (unreleased changes)
HADOOP-7034. Add TestPath tests to cover dot, dot dot, and slash normalization. (eli)
+ HADOOP-7032. Assert type constraints in the FileStatus constructor. (eli)
+
OPTIMIZATIONS
HADOOP-6884. Add LOG.isDebugEnabled() guard for each LOG.debug(..).
Modified: hadoop/common/branches/yahoo-merge/src/java/org/apache/hadoop/fs/FileStatus.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/yahoo-merge/src/java/org/apache/hadoop/fs/FileStatus.java?rev=1079130&r1=1079129&r2=1079130&view=diff
==============================================================================
--- hadoop/common/branches/yahoo-merge/src/java/org/apache/hadoop/fs/FileStatus.java (original)
+++ hadoop/common/branches/yahoo-merge/src/java/org/apache/hadoop/fs/FileStatus.java Tue Mar 8 04:38:02 2011
@@ -85,6 +85,11 @@ public class FileStatus implements Writa
this.group = (group == null) ? "" : group;
this.symlink = symlink;
this.path = path;
+ // The variables isdir and symlink indicate the type:
+ // 1. isdir implies directory, in which case symlink must be null.
+ // 2. !isdir implies a file or symlink, symlink != null implies a
+ // symlink, otherwise it's a file.
+ assert (isdir && symlink == null) || !isdir;
}
/**