-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Description
Out of a discussion in #26884, we should replace our beans introspection with a basic property determination algorithm that discovers the common scenarios for Spring applications but nothing more: no indexed properties, no JDK-level customizers, etc. This significantly streamlines the discovery process on startup and allows for straightforward usage in a native image (not relying on Introspector substitutions).
The implementation that is about to be pushed for RC2 gets rid of all common java.beans.Introspector
usage points in the codebase, replacing them with calls to PropertyDescriptorUtils.determineBasicProperties
and StringUtils.uncapitalizeAsProperty
. The entire core test suite passes with this.
Standard JavaBeans Introspector usage can be enforced through StandardBeanInfoFactory
configuration in a META-INF/spring.factories
file (a mechanism which existed for BeanInfo customizations before) with the following content:
org.springframework.beans.BeanInfoFactory=org.springframework.beans.StandardBeanInfoFactory
For Spring 5.3 compatible extended introspection including non-void setter methods:
org.springframework.beans.BeanInfoFactory=org.springframework.beans.ExtendedBeanInfoFactory
Neither of the two should be commonly necessary.