You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2007/06/26 17:40:26 UTC

[jira] Closed: (COLLECTIONS-257) CollectionUtils.removeAll() calls ListUtils.retainAll()

     [ https://issues.apache.org/jira/browse/COLLECTIONS-257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed COLLECTIONS-257.
-------------------------------------

       Resolution: Duplicate
    Fix Version/s: 3.3

Duplicate of COLLECTIONS-219, which has been fixed in trunk. 

> CollectionUtils.removeAll() calls ListUtils.retainAll()
> -------------------------------------------------------
>
>                 Key: COLLECTIONS-257
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-257
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Collection
>    Affects Versions: 3.2
>            Reporter: Sami Kallio
>             Fix For: 3.3
>
>
>     /**
>      * Returns a collection containing all the elements in <code>collection</code>
>      * that are also in <code>retain</code>. The cardinality of an element <code>e</code>
>      * in the returned collection is the same as the cardinality of <code>e</code>
>      * in <code>collection</code> unless <code>retain</code> does not contain <code>e</code>, in which
>      * case the cardinality is zero. This method is useful if you do not wish to modify
>      * the collection <code>c</code> and thus cannot call <code>c.retainAll(retain);</code>.
>      * 
>      * @param collection  the collection whose contents are the target of the #retailAll operation
>      * @param retain  the collection containing the elements to be retained in the returned collection
>      * @return a <code>Collection</code> containing all the elements of <code>collection</code>
>      * that occur at least once in <code>retain</code>.
>      * @throws NullPointerException if either parameter is null
>      * @since Commons Collections 3.2
>      */
>     public static Collection retainAll(Collection collection, Collection retain) {
>         return ListUtils.retainAll(collection, retain);
>     }
>     /**
>      * Removes the elements in <code>remove</code> from <code>collection</code>. That is, this
>      * method returns a collection containing all the elements in <code>c</code>
>      * that are not in <code>remove</code>. The cardinality of an element <code>e</code>
>      * in the returned collection is the same as the cardinality of <code>e</code>
>      * in <code>collection</code> unless <code>remove</code> contains <code>e</code>, in which
>      * case the cardinality is zero. This method is useful if you do not wish to modify
>      * the collection <code>c</code> and thus cannot call <code>collection.removeAll(remove);</code>.
>      * 
>      * @param collection  the collection from which items are removed (in the returned collection)
>      * @param remove  the items to be removed from the returned <code>collection</code>
>      * @return a <code>Collection</code> containing all the elements of <code>collection</code> except
>      * any elements that also occur in <code>remove</code>.
>      * @throws NullPointerException if either parameter is null
>      * @since Commons Collections 3.2
>      */
>     public static Collection removeAll(Collection collection, Collection remove) {
>         return ListUtils.retainAll(collection, remove);
>     }
> I guess the later method shoud be:
>     public static Collection removeAll(Collection collection, Collection remove) {
>         return ListUtils.removeAll(collection, remove);
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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