commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] Reopened: (BEANUTILS-300) NPE in LazyDynaList
Date Mon, 16 Feb 2009 23:51:02 GMT

     [ https://issues.apache.org/jira/browse/BEANUTILS-300?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sebb reopened BEANUTILS-300:
----------------------------


There is definitely something wrong with the code:

{code}
            if (dynaClass == null) {
                setElementType(elementType);
            }
                         
            // Create a new DynaBean            
            try {
                dynaBean = dynaClass.newInstance();
{code}

dynaClass is a local variable, so if it is null initially, it will be null later.
Either the variable can never be null initially, in which case the if statement should be
removed, or the variable can be null, in which case the NPE can occur.

> NPE in LazyDynaList
> -------------------
>
>                 Key: BEANUTILS-300
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-300
>             Project: Commons BeanUtils
>          Issue Type: Bug
>         Environment: Fortify
>            Reporter: Henri Yandell
>             Fix For: 1.8.0
>
>
> The transform() method does not protect lazyDynaClass from being null when the new DynaBean
is created.
> Throw an exception? Or should the setElementType(..) call be joined by a lazyDynaClass=...something....

-- 
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