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
This commit is contained in:
parent
2ad95ff46e
commit
db21443715
|
@ -105,10 +105,9 @@ public class InstantiateTransformer<T> implements Transformer<Class<? extends T>
|
||||||
*/
|
*/
|
||||||
public T transform(Class<? extends T> input) {
|
public T transform(Class<? extends T> input) {
|
||||||
try {
|
try {
|
||||||
if (input instanceof Class == false) {
|
if (input == null) {
|
||||||
throw new FunctorException(
|
throw new FunctorException(
|
||||||
"InstantiateTransformer: Input object was not an instanceof Class, it was a "
|
"InstantiateTransformer: Input object was not an instanceof Class, it was a null object");
|
||||||
+ (input == null ? "null object" : input.getClass().getName()));
|
|
||||||
}
|
}
|
||||||
Constructor<? extends T> con = input.getConstructor(iParamTypes);
|
Constructor<? extends T> con = input.getConstructor(iParamTypes);
|
||||||
return con.newInstance(iArgs);
|
return con.newInstance(iArgs);
|
||||||
|
|
Loading…
Reference in New Issue