Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Dec 15, 2013 · 3 comments
Assignees
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

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Dec 15, 2013

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

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Dec 16, 2013

Francesco Chicchiricco commented

Found same issue when trying to update Apache Syncope from Spring 3.2.5 to Spring 3.2.6 (took quite a while to understand, then found this issue via #15834).
I have opened SYNCOPE-462, which is blocked by this issue.

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Good catch! Fixed for 4.0.1 and 3.2.7 now, both to be released in January.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Chad Wilson commented

Thanks Juergen, appreciated.

@spring-projects-issues spring-projects-issues added type: bug A general bug status: backported An issue that has been backported to maintenance branches in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.0.1 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants