Return-Path: Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: (qmail 90480 invoked from network); 15 Nov 2010 05:06:30 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 15 Nov 2010 05:06:30 -0000 Received: (qmail 44030 invoked by uid 500); 15 Nov 2010 05:07:01 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 43907 invoked by uid 500); 15 Nov 2010 05:07:00 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 43899 invoked by uid 99); 15 Nov 2010 05:07:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Nov 2010 05:07:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Nov 2010 05:06:57 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 04E9023888D7; Mon, 15 Nov 2010 05:05:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1035147 - in /hadoop/common/trunk: CHANGES.txt src/java/org/apache/hadoop/fs/FileStatus.java Date: Mon, 15 Nov 2010 05:05:42 -0000 To: common-commits@hadoop.apache.org From: eli@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101115050543.04E9023888D7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: eli Date: Mon Nov 15 05:05:42 2010 New Revision: 1035147 URL: http://svn.apache.org/viewvc?rev=1035147&view=rev Log: HADOOP-7032. Assert type constraints in the FileStatus constructor. Contributed by Eli Collins Modified: hadoop/common/trunk/CHANGES.txt hadoop/common/trunk/src/java/org/apache/hadoop/fs/FileStatus.java Modified: hadoop/common/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=1035147&r1=1035146&r2=1035147&view=diff ============================================================================== --- hadoop/common/trunk/CHANGES.txt (original) +++ hadoop/common/trunk/CHANGES.txt Mon Nov 15 05:05:42 2010 @@ -175,6 +175,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/trunk/src/java/org/apache/hadoop/fs/FileStatus.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/fs/FileStatus.java?rev=1035147&r1=1035146&r2=1035147&view=diff ============================================================================== --- hadoop/common/trunk/src/java/org/apache/hadoop/fs/FileStatus.java (original) +++ hadoop/common/trunk/src/java/org/apache/hadoop/fs/FileStatus.java Mon Nov 15 05:05:42 2010 @@ -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; } /**