[
https://issues.apache.org/jira/browse/COLLECTIONS-862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gary D. Gregory resolved COLLECTIONS-862.
-----------------------------------------
Resolution: Invalid
> Bug CollectionUtils.collect(Iterable<? extends ?>, Transformer<? super ?, ?
> extends ? extends TransformerClosure<Object>>, LinkedList<Object>) and
> CollectionUtils.collect(Iterator<? extends ?>, Transformer<? super ?, ?
> extends ?>, Collection<Object>)
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: COLLECTIONS-862
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-862
> Project: Commons Collections
> Issue Type: Bug
> Reporter: Daniele
> Priority: Minor
>
> *CollectionUtils.collect(Iterable<? extends ?>, Transformer<? super ?, ?
> extends ? extends TransformerClosure<Object>>, LinkedList<Object>):*
> If args[2] is null and both, args[0] and args[1] are not null, the method
> does not throw any NullPointerException, although the specification says it
> does.
> *Test Used:*
> {code:java}
> public class CollectionUtils_16_failure_Test{
>
> public void
> testCollect_NullPointerException_OutputCollectionIsNullAndInputCollectionAndTransformerAreNotNull()
> throws Throwable {
> Stack<Predicate<Object>> stack0 = new Stack<Predicate<Object>>();
> Transformer<Object, TransformerClosure<Object>> transformer0 =
> InvokerTransformer.invokerTransformer("", (Class<?>[]) classArray0,
> (Object[]) classArray0);
> try {
> LinkedList<Object> linkedList0 =
> CollectionUtils.collect((Iterable<?>) stack0, (Transformer<? super Object, ?
> extends TransformerClosure<Object>>) transformer0, (LinkedList<Object>) null);
> org.junit.Assert.fail();
> } catch (java.lang.NullPointerException _e__) {
> }
> }
> }
> {code}
>
> *CollectionUtils.collect(Iterator<? extends ?>, Transformer<? super ?, ?
> extends ?>, Collection<Object>):*
> If args[2] is null and both, args[0] and args[1] are not null, the method
> does not throw any NullPointerException, although the specification says it
> does.
> *Test Used:*
> {code:java}
> public class CollectionUtils_17_failure_Test{
>
> public void
> testCollect_NullPointerException_OutputCollectionIsNullAndInputIteratorAndTransformerAreNotNull()
> throws Throwable {
> Transformer<Object, Object> transformer0 =
> InvokerTransformer.invokerTransformer("4s4F;4u$", (Class<?>[]) null,
> (Object[]) null);
> TreeSet<Object> treeSet0 = new TreeSet<Object>();
> Iterator<Object> iterator0 = treeSet0.iterator();
> try {
> Collection<Object> collection0 =
> CollectionUtils.collect((Iterator<?>) iterator0, (Transformer<? super Object,
> ?>) transformer0, (Collection<Object>) null);
> org.junit.Assert.fail();
> } catch (java.lang.NullPointerException _e__) {
> }
> }
> } {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)