Details
-
Improvement
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
2.2.0
-
None
-
None
-
Reviewed
Description
The values is initialized twice.
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
Attachments
- HADOOP-10208.patch
- 0.7 kB
- Benoy Antony
- HADOOP-10208.patch
- 0.9 kB
- Benoy Antony
- HADOOP-10208.patch
- 1 kB
- Benoy Antony
Activity
-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.
The findbugs are not related.
The test failures are related. I'll look into it and fix the code.
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.
-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.
Nit: "import java.util.Collections;" can be removed from the new patch. +1 after addressing the 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.
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
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
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
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
Attaching a simple patch which removes the duplicate initialization.