You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Ivan Popov (JIRA)" <ji...@apache.org> on 2008/03/19 12:32:26 UTC

[jira] Created: (BEANUTILS-311) DynaBean variables are evaluated before member variables.

DynaBean variables are evaluated before member variables.
---------------------------------------------------------

                 Key: BEANUTILS-311
                 URL: https://issues.apache.org/jira/browse/BEANUTILS-311
             Project: Commons BeanUtils
          Issue Type: Bug
          Components: Bean / Property Utils
    Affects Versions: 1.8.0-BETA
            Reporter: Ivan Popov


Hi,

I have a class that is a DynaBean (extends LazyDynaBean) and that has some member variables, in addition to those of the DynaBean.

It seems as if dynaBean variables are evaluated first, and as the property to evaluate is a member variable and not a dynaBean one,
it returns a NestedNullException.

Regards.

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


[jira] Commented: (BEANUTILS-311) DynaBean variables are evaluated before member variables.

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

Niall Pemberton commented on BEANUTILS-311:
-------------------------------------------

I don't think its a good idea to mix DynaBean with regular properties - so I think we should close this as WONTFIX.

> DynaBean variables are evaluated before member variables.
> ---------------------------------------------------------
>
>                 Key: BEANUTILS-311
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-311
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.8.0-BETA
>            Reporter: Ivan Popov
>
> Hi,
> I have a class that is a DynaBean (extends LazyDynaBean) and that has some member variables, in addition to those of the DynaBean.
> It seems as if dynaBean variables are evaluated first, and as the property to evaluate is a member variable and not a dynaBean one,
> it returns a NestedNullException.
> Regards.

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


[jira] Resolved: (BEANUTILS-311) DynaBean variables are evaluated before member variables.

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BEANUTILS-311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton resolved BEANUTILS-311.
---------------------------------------

    Resolution: Won't Fix

> DynaBean variables are evaluated before member variables.
> ---------------------------------------------------------
>
>                 Key: BEANUTILS-311
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-311
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.8.0-BETA
>            Reporter: Ivan Popov
>
> Hi,
> I have a class that is a DynaBean (extends LazyDynaBean) and that has some member variables, in addition to those of the DynaBean.
> It seems as if dynaBean variables are evaluated first, and as the property to evaluate is a member variable and not a dynaBean one,
> it returns a NestedNullException.
> Regards.

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


[jira] Commented: (BEANUTILS-311) DynaBean variables are evaluated before member variables.

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

Ivan Popov commented on BEANUTILS-311:
--------------------------------------

Thanks Niall for the advice. Overriding the get method is a good solution in my case.

Now, I understand why it is not recommended to use member variables and dynabean together.

Regards.

> DynaBean variables are evaluated before member variables.
> ---------------------------------------------------------
>
>                 Key: BEANUTILS-311
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-311
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.8.0-BETA
>            Reporter: Ivan Popov
>
> Hi,
> I have a class that is a DynaBean (extends LazyDynaBean) and that has some member variables, in addition to those of the DynaBean.
> It seems as if dynaBean variables are evaluated first, and as the property to evaluate is a member variable and not a dynaBean one,
> it returns a NestedNullException.
> Regards.

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


[jira] Commented: (BEANUTILS-311) DynaBean variables are evaluated before member variables.

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

Paul Benedict commented on BEANUTILS-311:
-----------------------------------------

I wouldn't leave this behavior, undefined. This is my suggestion (method names are just examples):

Add a new method called populateRealProperties which contains the logic to actually populate the real properties. Delegates to an overrideable method to perform custom logic if necessary.

public void populateRealProperties(....) {
    // maybe real logic will go here one day
   postProcessRealProperties();   // extra hook
}

> DynaBean variables are evaluated before member variables.
> ---------------------------------------------------------
>
>                 Key: BEANUTILS-311
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-311
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.8.0-BETA
>            Reporter: Ivan Popov
>
> Hi,
> I have a class that is a DynaBean (extends LazyDynaBean) and that has some member variables, in addition to those of the DynaBean.
> It seems as if dynaBean variables are evaluated first, and as the property to evaluate is a member variable and not a dynaBean one,
> it returns a NestedNullException.
> Regards.

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


[jira] Commented: (BEANUTILS-311) DynaBean variables are evaluated before member variables.

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

Niall Pemberton commented on BEANUTILS-311:
-------------------------------------------

Ivan,

Its not really a "bean with a Map" but an alternative to a POJO bean - see:

http://commons.apache.org/beanutils/apidocs/org/apache/commons/beanutils/package-summary.html#dynamic

One reason I don't think its a good idea is because of the very question "which should be evaulated first"? Another is because it could be inconsistent, depending on whether a property exists in a DynaBean or not. BeanUtils only ever treats DynaBean as DynaBeans (the same with Maps btw) - this is straightforward and consistent and I'm against making it any other way.

Starting coding getters/setters for DynaBean would seem bizarre to me - since one of their main points is not having to do that. If you want to though, then I suggest overriding the DynaBean's get/set methods and invoking your hand coded methods.

> DynaBean variables are evaluated before member variables.
> ---------------------------------------------------------
>
>                 Key: BEANUTILS-311
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-311
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.8.0-BETA
>            Reporter: Ivan Popov
>
> Hi,
> I have a class that is a DynaBean (extends LazyDynaBean) and that has some member variables, in addition to those of the DynaBean.
> It seems as if dynaBean variables are evaluated first, and as the property to evaluate is a member variable and not a dynaBean one,
> it returns a NestedNullException.
> Regards.

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


[jira] Commented: (BEANUTILS-311) DynaBean variables are evaluated before member variables.

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

Ivan Popov commented on BEANUTILS-311:
--------------------------------------

I don't see what is the problem of having member variables in a DynaBean.
DynaBean is no more than a bean with a map, isn't it ?
If someone can explain me please.

> DynaBean variables are evaluated before member variables.
> ---------------------------------------------------------
>
>                 Key: BEANUTILS-311
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-311
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.8.0-BETA
>            Reporter: Ivan Popov
>
> Hi,
> I have a class that is a DynaBean (extends LazyDynaBean) and that has some member variables, in addition to those of the DynaBean.
> It seems as if dynaBean variables are evaluated first, and as the property to evaluate is a member variable and not a dynaBean one,
> it returns a NestedNullException.
> Regards.

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