[
https://issues.apache.org/jira/browse/COLLECTIONS-361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903451#action_12903451
]
Jean-Noel Rouvignac edited comment on COLLECTIONS-361 at 8/30/10 9:11 AM:
--------------------------------------------------------------------------
In relation to COLLECTIONS-362, I would make CollectionUtils.filterOut() return
a boolean indicating whether the Collection as modified as a result of the call.
Here are some tests:
- test 1:
List l = new ArrayList();
l.add("test");
assertTrue( CollectionUtils.filterOut(l, TruePredicate.getInstance()) );
assertTrue(l.isEmpty());
- test 2:
List l = new ArrayList();
l.add("test");
assertFalse( CollectionUtils.filterOut(l, FalsePredicate.getInstance()) );
assertEquals(1, l.size());
was (Author: jnrouvignac):
In relation to COLLECTIONS-362, I would make CollectionUtils.filterOut()
return a boolean indicating whether the Collection as modified as a result of
the call.
Here are some tests:
- test 1:
List l = new ArrayList();
l.add("test");
assertTrue( CollectionUtils.filterOut(l, TruePredicate.getInstance()) );
assertTrue(l.isEmpty());
- test 2:
List l = new ArrayList();
l.add("test");
assertFalse( CollectionUtils.filterOut(l, FalsePredicate.getInstance()) );
assertEquals(1, l.size());
> Add CollectionUtils.filterOut()
> -------------------------------
>
> Key: COLLECTIONS-361
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-361
> Project: Commons Collections
> Issue Type: Wish
> Components: Collection
> Affects Versions: 1.0, 2.0, 2.1, 2.1.1, 3.0, 3.1, 3.2
> Reporter: Jean-Noel Rouvignac
> Priority: Trivial
>
> Similarly to CollectionUtils.selectRejected() which is equivalent to
> CollectionUtils.select() with using the NotPredicate, it would be nice to
> have CollectionUtils.filterOut() which would be equivalent to
> CollectionUtils.filter() with using the NotPredicate.
> I use filterOut() more often than filter().
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.