Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-10208

Remove duplicate initialization in StringUtils.getStringCollection

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 2.2.0
    • 2.3.0
    • None
    • None
    • Reviewed

    Description

      The values is initialized twice.

      StringUtils.java
       public static Collection<String> getStringCollection(String str){
          List<String> values = new ArrayList<String>();
          if (str == null)
            return values;
          StringTokenizer tokenizer = new StringTokenizer (str,",");
          values = new ArrayList<String>();
      

      Attachments

        1. HADOOP-10208.patch
          0.7 kB
          Benoy Antony
        2. HADOOP-10208.patch
          0.9 kB
          Benoy Antony
        3. HADOOP-10208.patch
          1 kB
          Benoy Antony

        Activity

          benoyantony Benoy Antony added a comment -

          Attaching a simple patch which removes the duplicate initialization.

          benoyantony Benoy Antony added a comment - Attaching a simple patch which removes the duplicate initialization.

          +1 for the patch. I will commit it soon.

          sureshms Suresh Srinivas added a comment - +1 for the patch. I will commit it soon.
          hadoopqa Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12621724/HADOOP-10208.patch
          against trunk revision .

          +1 @author. The patch does not contain any @author tags.

          -1 tests included. The patch doesn't appear to include any new or modified tests.
          Please justify why no new tests are needed for this patch.
          Also please list what manual steps were performed to verify this patch.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 eclipse:eclipse. The patch built with eclipse:eclipse.

          -1 findbugs. The patch appears to introduce 4 new Findbugs (version 1.3.9) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          -1 core tests. The patch failed these unit tests in hadoop-common-project/hadoop-common:

          org.apache.hadoop.conf.TestConfiguration

          +1 contrib tests. The patch passed contrib unit tests.

          Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/3405//testReport/
          Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/3405//artifact/trunk/patchprocess/newPatchFindbugsWarningshadoop-common.html
          Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/3405//console

          This message is automatically generated.

          hadoopqa Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12621724/HADOOP-10208.patch against trunk revision . +1 @author . The patch does not contain any @author tags. -1 tests included . The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . The javadoc tool did not generate any warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. -1 findbugs . The patch appears to introduce 4 new Findbugs (version 1.3.9) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. -1 core tests . The patch failed these unit tests in hadoop-common-project/hadoop-common: org.apache.hadoop.conf.TestConfiguration +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/3405//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/3405//artifact/trunk/patchprocess/newPatchFindbugsWarningshadoop-common.html Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/3405//console This message is automatically generated.
          benoyantony Benoy Antony added a comment -

          The findbugs are not related.
          The test failures are related. I'll look into it and fix the code.

          benoyantony Benoy Antony added a comment - The findbugs are not related. The test failures are related. I'll look into it and fix the code.
          benoyantony Benoy Antony added a comment -

          The failed test cases tries to add elements to the empty list returned by Collections.emptyList(). This fails because the Collections.emptyList() returns an unmodifiable empty list.

          Attaching a new patch which simply removes the duplicate initialization. The failed test cases are passing.

          benoyantony Benoy Antony added a comment - The failed test cases tries to add elements to the empty list returned by Collections.emptyList() . This fails because the Collections.emptyList() returns an unmodifiable empty list. Attaching a new patch which simply removes the duplicate initialization. The failed test cases are passing.
          hadoopqa Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12621821/HADOOP-10208.patch
          against trunk revision .

          +1 @author. The patch does not contain any @author tags.

          -1 tests included. The patch doesn't appear to include any new or modified tests.
          Please justify why no new tests are needed for this patch.
          Also please list what manual steps were performed to verify this patch.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 eclipse:eclipse. The patch built with eclipse:eclipse.

          -1 findbugs. The patch appears to introduce 4 new Findbugs (version 1.3.9) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed unit tests in hadoop-common-project/hadoop-common.

          +1 contrib tests. The patch passed contrib unit tests.

          Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/3409//testReport/
          Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/3409//artifact/trunk/patchprocess/newPatchFindbugsWarningshadoop-common.html
          Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/3409//console

          This message is automatically generated.

          hadoopqa Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12621821/HADOOP-10208.patch against trunk revision . +1 @author . The patch does not contain any @author tags. -1 tests included . The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . The javadoc tool did not generate any warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. -1 findbugs . The patch appears to introduce 4 new Findbugs (version 1.3.9) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in hadoop-common-project/hadoop-common. +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/3409//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/3409//artifact/trunk/patchprocess/newPatchFindbugsWarningshadoop-common.html Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/3409//console This message is automatically generated.
          benoyantony Benoy Antony added a comment -

          The findbugs are not related to this patch.

          benoyantony Benoy Antony added a comment - The findbugs are not related to this patch.
          jingzhao Jing Zhao added a comment -

          Nit: "import java.util.Collections;" can be removed from the new patch. +1 after addressing the comment.

          jingzhao Jing Zhao added a comment - Nit: "import java.util.Collections;" can be removed from the new patch. +1 after addressing the comment.
          benoyantony Benoy Antony added a comment -

          Remove the unnecessary import.

          benoyantony Benoy Antony added a comment - Remove the unnecessary import.
          hadoopqa Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12621876/HADOOP-10208.patch
          against trunk revision .

          +1 @author. The patch does not contain any @author tags.

          -1 tests included. The patch doesn't appear to include any new or modified tests.
          Please justify why no new tests are needed for this patch.
          Also please list what manual steps were performed to verify this patch.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 eclipse:eclipse. The patch built with eclipse:eclipse.

          -1 findbugs. The patch appears to introduce 4 new Findbugs (version 1.3.9) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed unit tests in hadoop-common-project/hadoop-common.

          +1 contrib tests. The patch passed contrib unit tests.

          Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/3411//testReport/
          Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/3411//artifact/trunk/patchprocess/newPatchFindbugsWarningshadoop-common.html
          Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/3411//console

          This message is automatically generated.

          hadoopqa Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12621876/HADOOP-10208.patch against trunk revision . +1 @author . The patch does not contain any @author tags. -1 tests included . The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . The javadoc tool did not generate any warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. -1 findbugs . The patch appears to introduce 4 new Findbugs (version 1.3.9) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in hadoop-common-project/hadoop-common. +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/3411//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/3411//artifact/trunk/patchprocess/newPatchFindbugsWarningshadoop-common.html Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/3411//console This message is automatically generated.
          jingzhao Jing Zhao added a comment -

          I've committed this to trunk and branch-2.

          jingzhao Jing Zhao added a comment - I've committed this to trunk and branch-2.
          hudson Hudson added a comment -

          SUCCESS: Integrated in Hadoop-trunk-Commit #4975 (See https://builds.apache.org/job/Hadoop-trunk-Commit/4975/)
          HADOOP-10208. Remove duplicate initialization in StringUtils.getStringCollection. Contributed by Benoy Antony. (jing9: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1556602)

          • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
          • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java
          hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-trunk-Commit #4975 (See https://builds.apache.org/job/Hadoop-trunk-Commit/4975/ ) HADOOP-10208 . Remove duplicate initialization in StringUtils.getStringCollection. Contributed by Benoy Antony. (jing9: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1556602 ) /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Yarn-trunk #447 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/447/)
          HADOOP-10208. Remove duplicate initialization in StringUtils.getStringCollection. Contributed by Benoy Antony. (jing9: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1556602)

          • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
          • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk #447 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/447/ ) HADOOP-10208 . Remove duplicate initialization in StringUtils.getStringCollection. Contributed by Benoy Antony. (jing9: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1556602 ) /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Hdfs-trunk #1639 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1639/)
          HADOOP-10208. Remove duplicate initialization in StringUtils.getStringCollection. Contributed by Benoy Antony. (jing9: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1556602)

          • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
          • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk #1639 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1639/ ) HADOOP-10208 . Remove duplicate initialization in StringUtils.getStringCollection. Contributed by Benoy Antony. (jing9: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1556602 ) /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java
          hudson Hudson added a comment -

          SUCCESS: Integrated in Hadoop-Mapreduce-trunk #1664 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1664/)
          HADOOP-10208. Remove duplicate initialization in StringUtils.getStringCollection. Contributed by Benoy Antony. (jing9: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1556602)

          • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
          • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java
          hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Mapreduce-trunk #1664 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1664/ ) HADOOP-10208 . Remove duplicate initialization in StringUtils.getStringCollection. Contributed by Benoy Antony. (jing9: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1556602 ) /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java

          People

            benoyantony Benoy Antony
            benoyantony Benoy Antony
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: