Skip to content

Prefer non-reflective access to ConfigurationClassPostProcessor #22858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

dsyer
Copy link
Member

@dsyer dsyer commented Aug 11, 2020

If the ConfigurationClassPostProcessor has been provided via an instance supplier then we can use that to set the MetadataReaderFactory non-reflectively, instead of using a PropertyValue (and the BeanWrapper eventually).

The old behavior is left as a fallback - probably without a change in Spring Framework it will continue to be the default.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 11, 2020
If the ConfigurationClassPostProcessor has been provided via an
instance supplier then we can use that to set the
MetadataReaderFactory non-reflectively, instead of using a
PropertyValue (and the BeanWrapper eventually). The old behaviour
is left as a fallback - probably without a change in Spring
Framework it will continue to be the default.
@philwebb philwebb added theme: graal type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 11, 2020
@philwebb philwebb added this to the 2.4.x milestone Aug 11, 2020
@philwebb
Copy link
Member

@dsyer I was looking to merge this but I'm a bit worried that it might cause early initialization of the MetadataReaderFactory. I'm not sure if calling this.context.getBean(BEAN_NAME, MetadataReaderFactory.class) from a BeanDefinitionRegistryPostProcessor is a good idea.

@philwebb
Copy link
Member

Oh wait, ignore me. I see you do that in the Supplier.

@philwebb philwebb modified the milestones: 2.4.x, 2.4.0-M2 Aug 11, 2020
philwebb pushed a commit that referenced this pull request Aug 11, 2020
Update `SharedMetadataReaderFactoryContextInitializer` to optionally
support a `ConfigurationClassPostProcessor` provided via an instance
`Supplier`.

If the instance supplier is available then we can use that to set the
`MetadataReaderFactory` non-reflectively, instead of using a
`PropertyValue` (and the `BeanWrapper` eventually).

The previous behavior is left as a  fallback and without a change in
Spring Framework will continue to be the default for most applications.

See gh-22858
@philwebb philwebb closed this in 4f8bf4d Aug 11, 2020
@mbhave mbhave added the theme: aot An issue related to Ahead-of-time processing label Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants