Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.9.0
-
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.