Update Javadoc for ignoreDependencyInterface() in AbstractAutowireCapableBeanFactory#34747
Closed
iggzq wants to merge 1 commit into
Closed
Update Javadoc for ignoreDependencyInterface() in AbstractAutowireCapableBeanFactory#34747iggzq wants to merge 1 commit into
ignoreDependencyInterface() in AbstractAutowireCapableBeanFactory#34747iggzq wants to merge 1 commit into
Conversation
…yInterface` method in the `AbstractAutowireCapableBeanFactory` class. The updated documentation now indicates that by default, the interfaces ignored are not only `BeanFactoryAware`, but also include `BeanNameAware`, `BeanFactoryAware`, and `BeanClassLoaderAware`. Specifically, the documentation update reflects that: - Initially, it was mentioned that only the `BeanFactoryAware` interface is ignored by default. - The updated documentation now correctly states that `BeanNameAware`, `BeanFactoryAware`, and `BeanClassLoaderAware` interfaces are all ignored by default. This change ensures a more accurate representation of the default behavior regarding which dependency interfaces are automatically ignored during autowiring in the context of Spring's bean factory mechanism. Signed-off-by: lituizi <2811328244@qq.com>
Contributor
Author
|
The comment of the method ignoreDependencyInterface in AbstractAutowireCapableBeanFactory.java.: /**
* Ignore the given dependency interface for autowiring.
* <p>This will typically be used by application contexts to register
* dependencies that are resolved in other ways, like BeanFactory through
* BeanFactoryAware or ApplicationContext through ApplicationContextAware.
* <p>By default, only the BeanFactoryAware interface is ignored.
* For further types to ignore, invoke this method for each type.
* @see org.springframework.beans.factory.BeanFactoryAware
* @see org.springframework.context.ApplicationContextAware
*/
public void ignoreDependencyInterface(Class<?> ifc) {
this.ignoredDependencyInterfaces.add(ifc);
}Based on all the constructors of AbstractAutowireCapableBeanFactory, we can find that the comment here is incorrect. |
ignoreDependencyInterface() in AbstractAutowireCapableBeanFactory
sbrannen
added a commit
that referenced
this pull request
Apr 14, 2025
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Specifically, the documentation update reflects that:
BeanFactoryAwareinterface is ignored by default.BeanNameAware,BeanFactoryAware, andBeanClassLoaderAwareinterfaces are all ignored by default.We can understand from the default constructor of AbstractAutowireCapableBeanFactory that: