You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2010/10/19 17:28:24 UTC
svn commit: r1024273 -
/commons/proper/collections/trunk/src/java/org/apache/commons/collections/collection/TransformedCollection.java
Author: sebb
Date: Tue Oct 19 15:28:24 2010
New Revision: 1024273
URL: http://svn.apache.org/viewvc?rev=1024273&view=rev
Log:
Remove unnecessary null checks
Modified:
commons/proper/collections/trunk/src/java/org/apache/commons/collections/collection/TransformedCollection.java
Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/collection/TransformedCollection.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/collection/TransformedCollection.java?rev=1024273&r1=1024272&r2=1024273&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/java/org/apache/commons/collections/collection/TransformedCollection.java (original)
+++ commons/proper/collections/trunk/src/java/org/apache/commons/collections/collection/TransformedCollection.java Tue Oct 19 15:28:24 2010
@@ -78,7 +78,8 @@ public class TransformedCollection<E> ex
*/
public static <E> Collection<E> decorateTransform(Collection<E> collection, Transformer<? super E, ? extends E> transformer) {
TransformedCollection<E> decorated = new TransformedCollection<E>(collection, transformer);
- if (transformer != null && collection != null && collection.size() > 0) {
+ // null collection & transformer are disallowed by the constructor call above
+ if (collection.size() > 0) {
@SuppressWarnings("unchecked") // collection is of type E
E[] values = (E[]) collection.toArray();
collection.clear();