You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Benedikt Ritter (JIRA)" <ji...@apache.org> on 2012/07/30 13:17:33 UTC

[jira] [Created] (BEANUTILS-416) Multiple calls to a property/method can result in a NPE

Benedikt Ritter created BEANUTILS-416:
-----------------------------------------

             Summary: Multiple calls to a property/method can result in a NPE
                 Key: BEANUTILS-416
                 URL: https://issues.apache.org/jira/browse/BEANUTILS-416
             Project: Commons BeanUtils
          Issue Type: Bug
          Components: Bean / Property Utils
    Affects Versions: 1.8.3
            Reporter: Benedikt Ritter


While working on BeanUtils2 we have found out, that the caching mechanism of BeanUtils can lead to NullPointerExceptions. Details can be found in SANDBOX-433.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BEANUTILS-416) Multiple calls to a property/method can result in a NPE

Posted by "Benedikt Ritter (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BEANUTILS-416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13428848#comment-13428848 ] 

Benedikt Ritter commented on BEANUTILS-416:
-------------------------------------------

I've found out, that BeanUtils is not affected directly by this issue. Although BeanUtils uses WeakReferences for cached values, there is code to prevent null pointers. For example:

{code:java}
Method method = getCachedMethod(md);
if (method != null) {
   return method;
}
{code}

I'd say that using WeakReferences for cached values in a WeakHashMap is broken, but since the code is backed up against NPEs, I'm fine if this issue is resolved as won't fix, since no failures are to be expected.
                
> Multiple calls to a property/method can result in a NPE
> -------------------------------------------------------
>
>                 Key: BEANUTILS-416
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-416
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.8.3
>            Reporter: Benedikt Ritter
>
> While working on BeanUtils2 we have found out, that the caching mechanism of BeanUtils can lead to NullPointerExceptions. Details can be found in SANDBOX-433.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BEANUTILS-416) Multiple calls to a property/method can result in a NPE

Posted by "Benedikt Ritter (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BEANUTILS-416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425192#comment-13425192 ] 

Benedikt Ritter commented on BEANUTILS-416:
-------------------------------------------

I've tried to break the caching of BU1, like I did for BU2. Although BU1 uses a similar caching consisting of a WeakHashMap with WeakReferences as values, it does somehow work.
                
> Multiple calls to a property/method can result in a NPE
> -------------------------------------------------------
>
>                 Key: BEANUTILS-416
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-416
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.8.3
>            Reporter: Benedikt Ritter
>
> While working on BeanUtils2 we have found out, that the caching mechanism of BeanUtils can lead to NullPointerExceptions. Details can be found in SANDBOX-433.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira