commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject svn commit: r1177393 - /commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/InstantiateTransformer.java
Date Thu, 29 Sep 2011 18:37:26 GMT
Author: dbrosius
Date: Thu Sep 29 18:37:26 2011
New Revision: 1177393

URL: http://svn.apache.org/viewvc?rev=1177393&view=rev
Log:
fix invalid parameter check -- only problem could be that it is null, not, not instanceof
Class

Modified:
    commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/InstantiateTransformer.java

Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/InstantiateTransformer.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/InstantiateTransformer.java?rev=1177393&r1=1177392&r2=1177393&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/InstantiateTransformer.java
(original)
+++ commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/InstantiateTransformer.java
Thu Sep 29 18:37:26 2011
@@ -105,10 +105,9 @@ public class InstantiateTransformer<T> i
      */
     public T transform(Class<? extends T> input) {
         try {
-            if (input instanceof Class == false) {
+            if (input == null) {
                 throw new FunctorException(
-                    "InstantiateTransformer: Input object was not an instanceof Class, it
was a "
-                        + (input == null ? "null object" : input.getClass().getName()));
+                    "InstantiateTransformer: Input object was not an instanceof Class, it
was a null object");
             }
             Constructor<? extends T> con = input.getConstructor(iParamTypes);
             return con.newInstance(iArgs);



Mime
View raw message