commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Janc (Jira)" <>
Subject [jira] [Created] (BEANUTILS-526) copyProperty should instantiate nested properties
Date Mon, 07 Oct 2019 11:46:00 GMT
Marco Janc created BEANUTILS-526:

             Summary: copyProperty should instantiate nested properties
                 Key: BEANUTILS-526
             Project: Commons BeanUtils
          Issue Type: Bug
          Components: Bean / Property Utils
    Affects Versions: 1.9.4
            Reporter: Marco Janc

The function _BeanUtils.copyProperty(bean, name, value)_ shall instantiate nested properties
before copying them.





*class Foo*
    *Bar bar;*

*class Bar*
    *int id;*


We now have an instance of _Foo_ where _bar_ property is null and call:

Foo foo = new Foo();
BeanUtils.copyProperty(foo, "", 3);
This will throw an exception currently.



In my generic copy method, i instantiate all required nested properties before.



This message was sent by Atlassian Jira

View raw message