commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Kestle (JIRA)" <j...@apache.org>
Subject [jira] Updated: (COLLECTIONS-218) CollectionUtils.select() does not return passed in collection
Date Tue, 18 Jul 2006 23:22:14 GMT
     [ http://issues.apache.org/jira/browse/COLLECTIONS-218?page=all ]

Stephen Kestle updated COLLECTIONS-218:
---------------------------------------

    Attachment: CollectionUtils select return.patch

Uploaded patch file for proposed changes.

I have also made changes to the two argument methods of select(), selectReject() and collect()
to be simple one-liners:

from:
   public static Collection collect(Collection inputCollection, Transformer transformer) {
        ArrayList answer = new ArrayList(inputCollection.size());
        collect(inputCollection, transformer, answer);
        return answer;
    }

to:
   public static Collection collect(Collection inputCollection, Transformer transformer) {
        return collect(inputCollection, transformer, new ArrayList(inputCollection.size()));
    }

I'll leave it up to you developers to figure out if that's a good or a bad thing...

> CollectionUtils.select() does not return passed in collection
> -------------------------------------------------------------
>
>                 Key: COLLECTIONS-218
>                 URL: http://issues.apache.org/jira/browse/COLLECTIONS-218
>             Project: Commons Collections
>          Issue Type: Improvement
>          Components: Collection
>    Affects Versions: 3.2, 3.1, 3.0, 2.1.1, 2.1, 2.0, 1.0, 3.3, Nightly Builds
>            Reporter: Stephen Kestle
>         Attachments: CollectionUtils select return.patch
>
>
> collect has the following methods: 
> Collection collect(Collection inputCollection, final Transformer transformer)
> Collection collect(Collection inputCollection, final Transformer transformer, final Collection
outputCollection)
> The first creates an ArrayList(), where the second takes an outputCollection and, for
convenience, returns it.
> Select (and selectReject) currently the following methods:
> Collection select(Collection inputCollection, Predicate predicate)
> void select(Collection inputCollection, Predicate predicate, Collection outputCollection)
> I propose changing the bottom method to return the passed in outputCollection.  It would
simplify calling code.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message