Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 099B611A97 for ; Mon, 5 May 2014 21:15:24 +0000 (UTC) Received: (qmail 94683 invoked by uid 500); 5 May 2014 21:15:18 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 94620 invoked by uid 500); 5 May 2014 21:15:17 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 94593 invoked by uid 99); 5 May 2014 21:15:17 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 May 2014 21:15:17 +0000 Date: Mon, 5 May 2014 21:15:17 +0000 (UTC) From: "Jing Zhao (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-6328) Simplify code in FSDirectory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-6328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13989982#comment-13989982 ] Jing Zhao commented on HDFS-6328: --------------------------------- The patch looks pretty good to me. Thanks for the cleanup. Some minors: # The changes on imports seem unnecessary # The following change may need to be reverted: {code} - Preconditions.checkArgument( - src.endsWith(HdfsConstants.SEPARATOR_DOT_SNAPSHOT_DIR), - "%s does not end with %s", src, HdfsConstants.SEPARATOR_DOT_SNAPSHOT_DIR); + Preconditions.checkArgument(src.endsWith(HdfsConstants.SEPARATOR_DOT_SNAPSHOT_DIR), "%s does not end with %s", src, HdfsConstants.SEPARATOR_DOT_SNAPSHOT_DIR); {code} # The following line exceeds 80 characters: {code} + return srcs.startsWith("/") && !srcs.endsWith("/") && getINode4Write(srcs, false) == null; {code} # Let's add "{}" for the while loop: {code} + while(src[i] == dst[i]) + i++; {code} +1 after addressing the comments. > Simplify code in FSDirectory > ---------------------------- > > Key: HDFS-6328 > URL: https://issues.apache.org/jira/browse/HDFS-6328 > Project: Hadoop HDFS > Issue Type: Sub-task > Components: namenode > Reporter: Haohui Mai > Assignee: Haohui Mai > Attachments: HDFS-6328.000.patch > > > This jira proposes: > # Cleaning up dead code in FSDirectory. > # Simplify the control flows that IntelliJ flags as warnings. > # Move functions related to resolving paths into one place. -- This message was sent by Atlassian JIRA (v6.2#6252)