You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/08/03 19:11:45 UTC
DO NOT REPLY [Bug 30408] -
CollectionUtils.transformedCollection(c,t) doesn't transform the elements of c
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30408>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=30408
CollectionUtils.transformedCollection(c,t) doesn't transform the elements of c
------- Additional Comments From cote@computer.org 2004-08-03 17:11 -------
I wrote the following test case that seem to confirm the bug :
public void testTransformedCollection_2() {
List list = new ArrayList();
list.add("1");
list.add("2");
list.add("3");
Collection result = CollectionUtils.transformedCollection(list,
TRANSFORM_TO_INTEGER);
assertTrue("returned object should be a TransformedCollection",
result instanceof TransformedCollection);
assertEquals("The transformed collection has the same size", 3,
result.size());
assertTrue("The transformed collection contains the transformation of
the first elements",result.contains(new Integer(1)));
assertTrue("The transformed collection contains the transformation of
the second elements",result.contains(new Integer(2)));
assertTrue("The transformed collection contains the transformation of
the third elements",result.contains(new Integer(3)));
assertFalse("The transformed collection doesn't contain the
transformation of the first elements",result.contains("1"));
assertFalse("The transformed collection doesn't contain the
transformation of the second elements",result.contains("2"));
assertFalse("The transformed collection doesn't contain the
transformation of the third elements",result.contains("3"));
}
(I will provide a proper patch to TestCollectionUtils.java as soon as I get
cvsgrab working with my proxy.)
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org