commons-issues mailing list archives

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


Sebb reopened BEANUTILS-300:

There is definitely something wrong with the code:

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

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

View raw message