From db21443715ce5b709f07cc6c50c8438c6405929a Mon Sep 17 00:00:00 2001 From: David Brosius Date: Thu, 29 Sep 2011 18:37:26 +0000 Subject: [PATCH] fix invalid parameter check -- only problem could be that it is null, not, not instanceof Class git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1177393 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/collections/functors/InstantiateTransformer.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/java/org/apache/commons/collections/functors/InstantiateTransformer.java b/src/java/org/apache/commons/collections/functors/InstantiateTransformer.java index ce1e5f22a..4f33f8491 100644 --- a/src/java/org/apache/commons/collections/functors/InstantiateTransformer.java +++ b/src/java/org/apache/commons/collections/functors/InstantiateTransformer.java @@ -105,10 +105,9 @@ public class InstantiateTransformer implements Transformer */ public T transform(Class 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 con = input.getConstructor(iParamTypes); return con.newInstance(iArgs);