commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton (JIRA)" <j...@apache.org>
Subject [jira] Commented: (BEANUTILS-309) Passing a null argument to ConstructorUtils.invokeConstructor causes NullPointerException
Date Wed, 05 Mar 2008 12:19:43 GMT

    [ https://issues.apache.org/jira/browse/BEANUTILS-309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12575319#action_12575319
] 

Niall Pemberton commented on BEANUTILS-309:
-------------------------------------------

btw there is also the following invokeConstructor() method:
  public static Object invokeConstructor(Class, Object[], Class[])

..where you can specify the parameter types and avoid this issue. So in the example I gave
above you would do the following to invoked the String constructor with a null argument:

ConstructorUtils.invokeConstructor(Foo.class, new Object[] {null}, new Class[] {String.class});

> Passing a null argument to ConstructorUtils.invokeConstructor causes NullPointerException
> -----------------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-309
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-309
>             Project: Commons BeanUtils
>          Issue Type: Bug
>    Affects Versions: 1.7.0, 1.8.0-BETA
>            Reporter: Xavier Poinsard
>
> I am invoking ConstructorUtils.invokeConstructor with an array of arguments and one of
these arguments is null.
> This causes a NullPointerException line 120 in Class ConstructorUtils.
> Since its not forbidden to pass null argument to a constructor, ConstructorUtils should
handle it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message