Author: tn Date: Mon Jan 21 10:11:42 2013 New Revision: 1436254 URL: http://svn.apache.org/viewvc?rev=1436254&view=rev Log: Fix findbugs warning wrt exposed internal representation.
Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/ChainedClosure.java commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/ChainedTransformer.java commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/SwitchClosure.java Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/ChainedClosure.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/ChainedClosure.java?rev=1436254&r1=1436253&r2=1436254&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/ChainedClosure.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/ChainedClosure.java Mon Jan 21 10:11:42 2013 @@ -104,12 +104,13 @@ public class ChainedClosure<E> implement } /** - * Gets the closures, do not modify the array. - * @return the closures + * Gets the closures. + * + * @return a copy of the closures * @since 3.1 */ public Closure<? super E>[] getClosures() { - return iClosures; + return FunctorUtils.copy(iClosures); } } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/ChainedTransformer.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/ChainedTransformer.java?rev=1436254&r1=1436253&r2=1436254&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/ChainedTransformer.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/ChainedTransformer.java Mon Jan 21 10:11:42 2013 @@ -105,12 +105,13 @@ public class ChainedTransformer<T> imple } /** - * Gets the transformers, do not modify the array. - * @return the transformers + * Gets the transformers. + * + * @return a copy of the transformers * @since 3.1 */ public Transformer<? super T, ? extends T>[] getTransformers() { - return iTransformers; + return FunctorUtils.copy(iTransformers); } } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/SwitchClosure.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/SwitchClosure.java?rev=1436254&r1=1436253&r2=1436254&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/SwitchClosure.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/SwitchClosure.java Mon Jan 21 10:11:42 2013 @@ -140,23 +140,23 @@ public class SwitchClosure<E> implements } /** - * Gets the predicates, do not modify the array. + * Gets the predicates. * - * @return the predicates + * @return a copy of the predicates * @since 3.1 */ public Predicate<? super E>[] getPredicates() { - return iPredicates; + return FunctorUtils.copy(iPredicates); } /** - * Gets the closures, do not modify the array. + * Gets the closures. * - * @return the closures + * @return a copy of the closures * @since 3.1 */ public Closure<? super E>[] getClosures() { - return iClosures; + return FunctorUtils.copy(iClosures); } /**