Uploaded image for project: 'Commons BeanUtils'
  1. Commons BeanUtils
  2. BEANUTILS-60

[beanutils] PropertyUtils.copyProperties does not copy to DynaBean

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5
    • None
    • None
    • None
    • Operating System: All
      Platform: PC

    • 14667

    Description

      I cannot seem to get PropertyUtils.copyProperties to copy to a DynaBean as the
      dest argument.

      here's what I'm seeing under PropertyUtils 1.32:

      in copyProperties:

      orig is neither Map nor DynaBean, so line 283 calls
      getPropertyDescriptors(orig). Then, for each readMethod in the result, line
      296 has:

      String name = origDescriptors[i].getName();
      if (getPropertyDescriptor(dest, name) != null) {

      But getting into getPropertyDescriptor(), line 869 calls
      getPropertyDescriptors(bean). If the dest is a DynaBean, I'm not seeing
      where the "instanceof DynaBean" is – it simply calls
      Introspector.getBeanInfo().getPropertyDescriptors(), but the result of
      getBeanInfo doesn't know anything about DynaBeans.

      What am I missing here? Rana says this is working and appreciate his input,
      especially with the release notes reference (thanks!) But tracing through
      the code and triple-checking at the beans (they both have a "name" property),
      I still can't see how this is going to work, and in practice, the destination
      DynaBean is untouched.

      Attachments

        Activity

          People

            Unassigned Unassigned
            topping@digidemic.com Brian Topping
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: