Skip to content
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

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

Closed
spring-issuemaster opened this issue Dec 15, 2013 · 3 comments

Comments

@spring-issuemaster
Copy link
Collaborator

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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Dec 16, 2013

Juergen Hoeller commented

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

Juergen

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Dec 16, 2013

Chad Wilson commented

Thanks Juergen, appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.