Author: tn
Date: Tue Jan 22 15:39:58 2013
New Revision: 1437000
URL: http://svn.apache.org/viewvc?rev=1437000&view=rev
Log:
Fix findbugs warning wrt exposure of internal state.
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/SwitchTransformer.java
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/SwitchTransformer.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/SwitchTransformer.java?rev=1437000&r1=1436999&r2=1437000&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/SwitchTransformer.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/SwitchTransformer.java
Tue Jan 22 15:39:58 2013
@@ -155,23 +155,23 @@ public class SwitchTransformer<I, O> imp
}
/**
- * 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 I>[] getPredicates() {
- return iPredicates;
+ return FunctorUtils.<I>copy(iPredicates);
}
/**
- * Gets the transformers, do not modify the array.
+ * Gets the transformers.
*
- * @return the transformers
+ * @return a copy of the transformers
* @since 3.1
*/
public Transformer<? super I, ? extends O>[] getTransformers() {
- return iTransformers;
+ return FunctorUtils.<I, O>copy(iTransformers);
}
/**