commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (COLLECTIONS-652) An obvious bug in CollectionUtils
Date Wed, 02 Aug 2017 16:51:00 GMT

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

Sebb resolved COLLECTIONS-652.
------------------------------
       Resolution: Fixed
    Fix Version/s: 3.2.2

This was fixed in 3.2.2

> An obvious bug in CollectionUtils
> ---------------------------------
>
>                 Key: COLLECTIONS-652
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-652
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Collection
>    Affects Versions: 3.2.1
>         Environment: windows 7, jdk8. This bug is so obvious so I think it is nothing
to do with environment
>            Reporter: samray leung
>            Priority: Minor
>              Labels: easyfix
>             Fix For: 3.2.2
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> In CollectionUtils.java:
> Line number: 1121
>     /**
>      * 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);
>     }
> The method should call ListUtils.removeAll(Collection collection, Collection remove)
instead of calling ListUtils.retailAll(collection,remove)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message