You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some check, i think maybe SpyPostProcessor does not following the spec of SmartInstantiationAwareBeanPostProcessor.
The exposed object should be equivalent to the what postProcessBeforeInitialization / postProcessAfterInitialization would expose otherwise. Note that the object returned by this method will be used as bean reference unless the post-processor returns a different wrapper from said post-process callbacks. In other words: Those post-process callbacks may either eventually expose the same reference or alternatively return the raw bean instance from those subsequent callbacks (if the wrapper for the affected bean has been built for a call to this method already, it will be exposes as final bean reference by default).
getEarlyBeanReference, postProcessAfterInitialization may return two different spy objects in current implementation.
The text was updated successfully, but these errors were encountered:
I have a fix for this but I'd like to discuss with the team when, and even if, we want to make the change as it's not without risk.
philwebb
changed the title
@SpyBean cause BeanCurrentlyInCreationException when there are circular references
@SpyBean causes BeanCurrentlyInCreationException when there are circular references
Feb 18, 2022
Uh oh!
There was an error while loading. Please reload this page.
When
@SpyBean
is used on a field which is a circular reference, will raise aBeanCurrentlyInCreationException
.Sample project that reproduces the problem: https://github.com/huangyoje/spybean-test
After some check, i think maybe
SpyPostProcessor
does not following the spec ofSmartInstantiationAwareBeanPostProcessor
.getEarlyBeanReference, postProcessAfterInitialization
may return two different spy objects in current implementation.The text was updated successfully, but these errors were encountered: