Affects: 5.0.x


boolean resolved = false;
boolean autowireNecessary = false;
if (args == null) {
    synchronized (mbd.constructorArgumentLock) {
        if (mbd.resolvedConstructorOrFactoryMethod != null) {
            resolved = true;
            autowireNecessary = mbd.constructorArgumentsResolved;
        }
    }
}
if (resolved) {

    if (autowireNecessary) {
        return autowireConstructor(beanName, mbd, null, null);
    }
    else {
        return instantiateBean(beanName, mbd);
    }
}


If autowireNecessary is false, the object is created as a factory by adding @Bean annotation, then it will not go to the constructor method, I want to know what scenario will be established?I thought for a long time,thanks!