You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "johan zahri (JIRA)" <ji...@apache.org> on 2015/06/03 13:32:49 UTC

[jira] [Created] (BEANUTILS-476) copy derived properties not working when parent class attribute is public

johan zahri created BEANUTILS-476:
-------------------------------------

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