Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-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 264D318EF3 for ; Wed, 1 Jul 2015 00:48:05 +0000 (UTC) Received: (qmail 46043 invoked by uid 500); 1 Jul 2015 00:48:04 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 45990 invoked by uid 500); 1 Jul 2015 00:48:04 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 45973 invoked by uid 99); 1 Jul 2015 00:48:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Jul 2015 00:48:04 +0000 Date: Wed, 1 Jul 2015 00:48:04 +0000 (UTC) From: "Lei (Eddy) Xu (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HADOOP-12164) Fix TestMove and TestFsShellReturnCode failed to get command name using reflection. 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/HADOOP-12164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lei (Eddy) Xu updated HADOOP-12164: ----------------------------------- Resolution: Fixed Fix Version/s: 2.8.0 3.0.0 Status: Resolved (was: Patch Available) Thanks a lot for the quick review, [~andrew.wang]. I've committed it into branch-2 and trunk. > Fix TestMove and TestFsShellReturnCode failed to get command name using reflection. > ----------------------------------------------------------------------------------- > > Key: HADOOP-12164 > URL: https://issues.apache.org/jira/browse/HADOOP-12164 > Project: Hadoop Common > Issue Type: Bug > Affects Versions: 2.7.0 > Reporter: Lei (Eddy) Xu > Assignee: Lei (Eddy) Xu > Priority: Minor > Fix For: 3.0.0, 2.8.0 > > Attachments: HADOOP-12164.000.patch > > > When enabled {{hadoop.shell.missing.defaultFs.warning}}, a few tests were failed as following: > {noformat} > java.lang.RuntimeException: failed to get .NAME > at java.lang.Class.getDeclaredField(Class.java:1948) > at org.apache.hadoop.fs.shell.Command.getCommandField(Command.java:458) > at org.apache.hadoop.fs.shell.Command.getName(Command.java:401) > at org.apache.hadoop.fs.shell.FsCommand.getCommandName(FsCommand.java:80) > at org.apache.hadoop.fs.shell.FsCommand.processRawArguments(FsCommand.java:111) > at org.apache.hadoop.fs.shell.Command.run(Command.java:154) > at org.apache.hadoop.fs.TestFsShellReturnCode.testChgrpGroupValidity(TestFsShellReturnCode.java:434) > {noformat} > The reason is that, in {{FsCommand#processRawArguments}}, it uses {{getCommandName()}}, which uses reflection to find {{static String NAME}} field, to build error message. But in the tests, the commands are built without {{static String NAME}} field, since it is not inherited. -- This message was sent by Atlassian JIRA (v6.3.4#6332)