Description
manny veloso opened SPR-10674 and commented
According to the docs, getSingleton(String beanName) is not supposed to attempt to create the singleton if it doesn't exist.
"Only checks already instantiated singletons; does not return an Object for singleton bean definitions which have not been instantiated yet."
However, the code calls getSingleton(beanName, true). Calling getSingleton(beanName, true) attempts to create the bean if not found in the registry.
Note that a quick search through the spring sources show that the usage of getSingleton(String beanName) is consistent with the documentation ie: code that uses getSingleton(beanName) attempts to create the bean if null is returned from the function. In addition, one other use checks the existence of the bean in the registry before trying to retriev eit.
Affects: 3.1.4, 3.2.3
Issue Links:
- Non-singleton beans performance issue [SPR-9819] #14452 Non-singleton beans performance issue