Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-11231

Backward compatibility of BeanUtils.copyProperties broken for copying wrapped types to primitive types (and vice versa) on 3.2.6 and 4.0.0

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 3.2.6, 4.0 GA
    • Fix Version/s: 3.2.7, 4.0.1
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      The change made for SPR-11209 in https://github.com/spring-projects/spring-framework/commit/bc5affa79a67b28c858730dd69156ebf6161164a 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 [email protected](lhsType, rhsType) to handle this without breaking backwards compatibility?

        Attachments

          Activity

            People

            Assignee:
            juergen.hoeller Juergen Hoeller
            Reporter:
            voiceinsideyou Chad Wilson
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 37 weeks, 5 days ago