Skip to content

Perform basic property determination without java.beans.Introspector #29320

@jhoeller

Description

@jhoeller

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.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions