#32 BeanCopier NullPointerException for read-only properties

open
nobody
None
5
2010-04-27
2010-04-27
No

BeanCopier.copy throws a NullPointerException if the target bean contains a property without a setter and the copier tries to set that property. It should skip read-only properties. The cause is that BeanCopier.generateClass reads the property getters instead the setters of the target bean. I've attached a patch which adds a testcase demonstrating the error and a fix for the BeanCopier.

This bug is the same as bugs 1516879 and 1516861. I have opened a new bug because I wanted to provide a better summary and add the patch.

Discussion

  • Michael Koch

    Michael Koch - 2010-04-27

    Small correction: the NullPointerException occurs when calling BeanCopier.create, not BeanCopier.copy.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks