I wonder what's the idea with this? Is this a bug or a feature? Using 1.8.3.

public class BeanUtilsTest {

    @Test
    public void testCopyProperties() throws Exception {

        SomeBean bean = new SomeBean();
        assertNull(bean.getId());

        BeanUtils.copyProperties(bean, new SomeBean());
        assertNull(bean.getId()); // Fails because bean.getId() returns 0.
    }

    public static class SomeBean {

        private Long id;

        public Long getId() {
            return id;
        }

        public void setId(Long id) {
            this.id = id;
        }
    }
}

____________________________________________________________
Publish your photos in seconds for FREE
TRY IM TOOLPACK at http://www.imtoolpack.com/default.aspx?rc=if4



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to