Skip to content

Use ExtendedBeanInfo on an as-needed basis only [SPR-9723] #14357

Closed
@spring-projects-issues

Description

@spring-projects-issues

Chris Beams opened SPR-9723 and commented

Create an ExtendedBeanInfoFactory that inspects a given bean class, determining whether that bean class is a candidate for EBI's functionality. i.e. does the bean class have non-void returning setter methods?

If so, handle the class and return an ExtendedBeanInfo.

If not, return false from from ExtendedBeanInfo#supports(Class) and have CachedIntrospectionResults fall back to the default Introspector#getBeanInfo.

This will resolve a number of open issues that are essentially regressions due to the introduction of ExtendedBeanInfo. The issues with ExtendedBeanInfo should of course also be fixed, but getting EBI out of the execution path for classes that don't need it means better performance and lower risk of bugs in the future.

An open question is whether the ExtendedBeanInfoFactory should be discovered via the META-INF/spring.beanInfoFactories mechanism, or simply hard-coded. In either case, it will always be picked up. Hard coding it means explicitness, type safety, etc. Discovery via META-INF means that there is a prominent example of the mechanism that others can look to without digging into tests.


Issue Links:

Referenced from: commits spring-attic/spring-framework-issues@114ca5c

Metadata

Metadata

Assignees

No one assigned

    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