Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-566

BeanHelper.createBean() can't support Map<> bean property loading from file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.10
    • None
    • Type conversion
    • None

    Description

      The issue is BeanUtils.setProperty() can support the java Map bean to set the (key, value) entry. But the BeahHelper.initProperty() add 1 more PropertyUtils.isWriteable() check. While this PropertyUtils.isWriteable() doesn't support java Map bean.

      The check "PropertyUtils.isWriteable()" is quite redundant and unnecessary.

      Is it better to remove the check "PropertyUtils.isWriteable()" since the BeanUtils.setProperty() has various ways to set the properties?

      BeanHelper.createBean() 
       -> DefaultBeanFactory.createBean()
            -> DefaultBeanFactory.initBeanInstance()
                 -> BeanHelper.initBean()
                      ->BeahHelper.initProperty()
                         {
                              if (!PropertyUtils.isWriteable(bean, propName))
                              ...
                              BeanUtils.setProperty(bean, propName, value);
                         }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            dreamershl Shen liang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: