[
https://issues.apache.org/jira/browse/HADOOP-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13864442#comment-13864442
]
Benoy Antony commented on HADOOP-10208:
---------------------------------------
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.
> Remove duplicate initialization in StringUtils.getStringCollection
> ------------------------------------------------------------------
>
> Key: HADOOP-10208
> URL: https://issues.apache.org/jira/browse/HADOOP-10208
> Project: Hadoop Common
> Issue Type: Improvement
> Affects Versions: 2.2.0
> Reporter: Benoy Antony
> Assignee: Benoy Antony
> Priority: Trivial
> Attachments: HADOOP-10208.patch, HADOOP-10208.patch
>
>
> The *values* is initialized twice.
> {code:title=StringUtils.java|borderStyle=solid}
> 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>();
> {code}
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)