Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 98989 invoked from network); 16 Jun 2008 17:04:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Jun 2008 17:04:07 -0000 Received: (qmail 13303 invoked by uid 500); 16 Jun 2008 17:04:08 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 13262 invoked by uid 500); 16 Jun 2008 17:04:08 -0000 Mailing-List: contact core-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-dev@hadoop.apache.org Received: (qmail 13251 invoked by uid 99); 16 Jun 2008 17:04:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jun 2008 10:04:08 -0700 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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jun 2008 17:03:26 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 21E39234C143 for ; Mon, 16 Jun 2008 10:03:45 -0700 (PDT) Message-ID: <1328617175.1213635825137.JavaMail.jira@brutus> Date: Mon, 16 Jun 2008 10:03:45 -0700 (PDT) From: "Owen O'Malley (JIRA)" To: core-dev@hadoop.apache.org Subject: [jira] Updated: (HADOOP-3568) Don't need to use toString() on strings (code cleanup) In-Reply-To: <1408353712.1213629346544.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-3568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Owen O'Malley updated HADOOP-3568: ---------------------------------- Description: Don't need to call toString on a String type. This occurs in several places in the test code. Patches below: was: Don't need to call toString on a String type. This occurs in several places in the test code. Patches below: patch to org.apache.hadoop.dfs.TestDFSStartupVersions Index: . =================================================================== --- . (revision 8259) +++ . (working copy) @@ -37,7 +37,7 @@ private static final Log LOG = LogFactory.getLog( "org.apache.hadoop.dfs.TestDFSStartupVersions"); private static Path TEST_ROOT_DIR = new Path( - System.getProperty("test.build.data","/tmp").toString().replace(' ', '+')); + System.getProperty("test.build.data","/tmp").replace(' ', '+')); private MiniDFSCluster cluster = null; /** patch to org.apache.hadoop.mapred.lib.aggregate.TestAggregates Index: . =================================================================== --- . (revision 8259) +++ . (working copy) @@ -109,7 +109,7 @@ Path outPath = new Path(OUTPUT_DIR, "part-00000"); String outdata = TestMiniMRWithDFS.readOutput(outPath,job); System.out.println("full out data:"); - System.out.println(outdata.toString()); + System.out.println(outdata); outdata = outdata.substring(0, expectedOutput.toString().length()); assertEquals(expectedOutput.toString(),outdata); patch to org.apache.hadoop.mapred.NotificationTestCase Index: . =================================================================== --- . (revision 8259) +++ . (working copy) @@ -174,8 +174,7 @@ // Hack for local FS that does not have the concept of a 'mounting point' if (isLocalFS()) { - String localPathRoot = System.getProperty("test.build.data","/tmp") - .toString().replace(' ', '+');; + String localPathRoot = System.getProperty("test.build.data","/tmp").replace(' ', '+');; inDir = new Path(localPathRoot, inDir); outDir = new Path(localPathRoot, outDir); } patch to org.apache.hadoop.streaming.TestMultipleArchiveFiles Index: . =================================================================== --- . (revision 8259) +++ . (working copy) @@ -84,7 +84,7 @@ dos.write(inputFileString.getBytes("UTF-8")); dos.close(); - DataOutputStream out = fileSys.create(new Path(CACHE_ARCHIVE_1.toString())); + DataOutputStream out = fileSys.create(new Path(CACHE_ARCHIVE_1)); ZipOutputStream zos = new ZipOutputStream(out); ZipEntry ze = new ZipEntry(CACHE_FILE_1.toString()); zos.putNextEntry(ze); @@ -112,7 +112,7 @@ } return new String[] { - "-input", INPUT_FILE.toString(), + "-input", INPUT_FILE, "-output", OUTPUT_DIR, "-mapper", "xargs cat", "-reducer", "cat", Please don't put patches in the comments and especially not in the description, which is sent out each time someone comments on it. Please generate a patch from HADOOP_HOME via "svn diff" and upload it to this jira. Then make the patch available for review by pressing "submit patch." Thanks! BTW, here is your removed patch patch to org.apache.hadoop.dfs.TestDFSStartupVersions Index: . =================================================================== --- . (revision 8259) +++ . (working copy) @@ -37,7 +37,7 @@ private static final Log LOG = LogFactory.getLog( "org.apache.hadoop.dfs.TestDFSStartupVersions"); private static Path TEST_ROOT_DIR = new Path( - System.getProperty("test.build.data","/tmp").toString().replace(' ', '+')); + System.getProperty("test.build.data","/tmp").replace(' ', '+')); private MiniDFSCluster cluster = null; /** patch to org.apache.hadoop.mapred.lib.aggregate.TestAggregates Index: . =================================================================== --- . (revision 8259) +++ . (working copy) @@ -109,7 +109,7 @@ Path outPath = new Path(OUTPUT_DIR, "part-00000"); String outdata = TestMiniMRWithDFS.readOutput(outPath,job); System.out.println("full out data:"); - System.out.println(outdata.toString()); + System.out.println(outdata); outdata = outdata.substring(0, expectedOutput.toString().length()); assertEquals(expectedOutput.toString(),outdata); patch to org.apache.hadoop.mapred.NotificationTestCase Index: . =================================================================== --- . (revision 8259) +++ . (working copy) @@ -174,8 +174,7 @@ // Hack for local FS that does not have the concept of a 'mounting point' if (isLocalFS()) { - String localPathRoot = System.getProperty("test.build.data","/tmp") - .toString().replace(' ', '+');; + String localPathRoot = System.getProperty("test.build.data","/tmp").replace(' ', '+');; inDir = new Path(localPathRoot, inDir); outDir = new Path(localPathRoot, outDir); } patch to org.apache.hadoop.streaming.TestMultipleArchiveFiles Index: . =================================================================== --- . (revision 8259) +++ . (working copy) @@ -84,7 +84,7 @@ dos.write(inputFileString.getBytes("UTF-8")); dos.close(); - DataOutputStream out = fileSys.create(new Path(CACHE_ARCHIVE_1.toString())); + DataOutputStream out = fileSys.create(new Path(CACHE_ARCHIVE_1)); ZipOutputStream zos = new ZipOutputStream(out); ZipEntry ze = new ZipEntry(CACHE_FILE_1.toString()); zos.putNextEntry(ze); @@ -112,7 +112,7 @@ } return new String[] { - "-input", INPUT_FILE.toString(), + "-input", INPUT_FILE, "-output", OUTPUT_DIR, "-mapper", "xargs cat", "-reducer", "cat", > Don't need to use toString() on strings (code cleanup) > ------------------------------------------------------ > > Key: HADOOP-3568 > URL: https://issues.apache.org/jira/browse/HADOOP-3568 > Project: Hadoop Core > Issue Type: Improvement > Components: test > Affects Versions: 0.17.0 > Reporter: Tim Halloran > Priority: Minor > > Don't need to call toString on a String type. This occurs in several places in the test code. Patches below: -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.