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

johan zahri updated BEANUTILS-476:
----------------------------------
    Description: 
In my case, I have a class B that extends A. property x defined as public in A 
but overridden as private in B with getters and setter defined as public.
When performing a BeanUtils.copyProperties operation on instance of B as the 
source, the value of the target copies the value coming from A rather than from 
B which has a public getter and setter.
I would assume that this should not be the correct behaviour?

eg:
A{public x;}
B extends A
{private x;public getX();public setX(x);}
((A)b).x=null
b.x="val"
BeanUtils.copyProperties (c,b);
Result : c.x=null
Expected: c.x="val"

  was:
In my case, I have a class B that extends A. property x defined as public in A 
but overridden as private in B with getters and setter defined as public.
When performing a BeanUtils.copyProperties operation on instance of B as the 
source, the value of the target copies the value coming from A rather than from 
B which has a public getter and setter.
I would assume that this should not be the correct behaviour?

eg:
A{public x;}
B extends A
{private x;public getX();public setX(x);}
a.x=null
b.x="val"
BeanUtils.copyProperties (c,b);
Result : c.x=null
Expected: c.x="val"


> copy derived properties not working when parent class attribute is public
> -------------------------------------------------------------------------
>
>                 Key: BEANUTILS-476
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-476
>             Project: Commons BeanUtils
>          Issue Type: Bug
>    Affects Versions: 1.9.2
>         Environment: JDK 7
>            Reporter: johan zahri
>
> In my case, I have a class B that extends A. property x defined as public in 
> A but overridden as private in B with getters and setter defined as public.
> When performing a BeanUtils.copyProperties operation on instance of B as the 
> source, the value of the target copies the value coming from A rather than 
> from B which has a public getter and setter.
> I would assume that this should not be the correct behaviour?
> eg:
> A{public x;}
> B extends A
> {private x;public getX();public setX(x);}
> ((A)b).x=null
> b.x="val"
> BeanUtils.copyProperties (c,b);
> Result : c.x=null
> Expected: c.x="val"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to