Backward compatibility of BeanUtils.copyProperties broken for copying wrapped types to primitive types (and vice versa) on 3.2.6 and 4.0.0 [SPR-11231] #15856
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
Chad Wilson opened SPR-11231 and commented
The change made for #15834 in bc5affa appears to have broken backward compatibility for primitive types where boxing/autoboxing was required between read and write methods.
Boolean.class is not "assignable" from boolean.class (and similar for other types) however this previously worked fine using BeanUtils.copyProperties, relying on auto boxing/unboxing.
Was this change intentional?
Could you consider using org.springframework.util.ClassUtils@isAssignable(lhsType, rhsType) to handle this without breaking backwards compatibility?
Affects: 3.2.6, 4.0 GA
Referenced from: commits 8a3b4c6, 0a4d28d
Backported to: 3.2.7
The text was updated successfully, but these errors were encountered: