Calling setter methods even though values are equal

25 views
Skip to first unread message

DImuthu Upeksha

unread,
Dec 4, 2019, 5:18:55 PM12/4/19
to Dozer Mapper
Hi,

We are doing some POJO to Thrift Stub conversion using the dozer mapper and there is an integer field in both objects with same name and value = 0. For that property, in some cases line [1] becomes true  due to the Autoboxing cache in JVM [2] as getPropertyValue(bean) is getting the same object as "value" from cache. Because of that, in some cases it calls setter method of target property and sometimes it doesn't. However we are doing more stuff in the setter method in target property, we need to call that method always irrespective of the value. Do you think that this is a bug in the code or is there a workaround to make setters invoked always?


Thanks
Dimuthu

Mike Autenrieb

unread,
Dec 3, 2020, 9:55:04 AM12/3/20
to Dozer Mapper
I am having the exact same issue. Is there a fix for this or should I make a custom converter?
Reply all
Reply to author
Forward
0 new messages