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

Write methods for PropertyDescriptors created during custom introspection are lost

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.9.0
    • 1.9.1
    • Bean / Property Utils
    • None

    Description

      From version 1.9.0 on, BeanUtils allows custom introspection. This means that the properties of classes are supported which do not necessarily conform to the Java Beans specification.

      During introspection PropertyDescriptor objects are created for the properties detected. For properties not conforming to the Java Beans specification it seems that these descriptor objects are not very durable:

      The write method passed to a PropertyDescriptor is internally stored as SoftReference (at least in Java 1.7). If necessary, it has to be obtained anew when it is accessed. The code which does this contains some checks whether the retrieved method is compliant to the Java Beans specification. If not, the property's write method is set to null.

      Unfortunately, this has the effect that certain PropertyDescriptor objects created during the introspection phase are no longer usable after their SoftReferences have been claimed by the GC.

      Attachments

        Activity

          People

            Unassigned Unassigned
            oheger Oliver Heger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: