From 88b7b4b3a07390db01c9fe2ae15581ace220032b Mon Sep 17 00:00:00 2001 From: Thomas Neidhart Date: Thu, 26 Jul 2012 21:18:24 +0000 Subject: [PATCH] [COLLECTIONS-379] Fixed javadoc in CollectionUtils. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1366204 13f79535-47bb-0310-9956-ffa450edef68 --- src/changes/changes.xml | 3 +++ .../commons/collections/CollectionUtils.java | 20 ++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index f3ab46c97..46733c8f5 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -22,6 +22,9 @@ + + Fixed javadoc for several methods wrt expected NullPointerExceptions. + Added an implementation of Eugene Myers difference algorithm. diff --git a/src/main/java/org/apache/commons/collections/CollectionUtils.java b/src/main/java/org/apache/commons/collections/CollectionUtils.java index 8285c1fe8..c56c78192 100644 --- a/src/main/java/org/apache/commons/collections/CollectionUtils.java +++ b/src/main/java/org/apache/commons/collections/CollectionUtils.java @@ -610,8 +610,9 @@ public class CollectionUtils { * @param predicate * the predicate to use, may be null * @param outputCollection - * the collection to output into, may not be null - * @return outputCollection + * the collection to output into, may not be null if the inputCollection + * and predicate or not null + * @return the outputCollection */ public static > R select(Collection inputCollection, Predicate predicate, R outputCollection) { @@ -657,7 +658,8 @@ public class CollectionUtils { * @param predicate * the predicate to use, may be null * @param outputCollection - * the collection to output into, may not be null + * the collection to output into, may not be null if the inputCollection + * and predicate or not null * @return outputCollection */ public static > R selectRejected( @@ -726,12 +728,14 @@ public class CollectionUtils { * * @param inputCollection the collection to get the input from, may be null * @param transformer the transformer to use, may be null - * @param outputCollection the collection to output into, may not be null + * @param outputCollection the collection to output into, may not be null if the inputCollection + * and transformer are not null * @param the type of object in the input collection * @param the type of object in the output collection * @param the output type of the transformer - this extends O. * @return the outputCollection with the transformed input added - * @throws NullPointerException if the output collection is null + * @throws NullPointerException if the output collection is null and both, inputCollection and + * transformer are not null */ public static > R collect(Iterable inputCollection, final Transformer transformer, final R outputCollection) { @@ -750,12 +754,14 @@ public class CollectionUtils { * * @param inputIterator the iterator to get the input from, may be null * @param transformer the transformer to use, may be null - * @param outputCollection the collection to output into, may not be null + * @param outputCollection the collection to output into, may not be null if the inputCollection + * and transformer are not null * @param the type of object in the input collection * @param the type of object in the output collection * @param the output type of the transformer - this extends O. * @return the outputCollection with the transformed input added - * @throws NullPointerException if the output collection is null + * @throws NullPointerException if the output collection is null and both, inputCollection and + * transformer are not null */ //TODO - deprecate and replace with IteratorIterable public static > R collect(Iterator inputIterator,