Assume the following FactoryBean implementation:
Now assume we have a SmartInstantiationAwareBeanPostProcessor registered that does return an arbitrary different type from a call to predictBeanType(...). If you now call BeanFactory.getBeansOfType(AnInterface.class) the registered bean instance will not be returned as the type check is done against the type the factory produces in the first place. If that fails the actual bean type is checked against the given type if the bean definition is considered a factory bean.
AbstractBeanFactory.isFactoryBean(...) now inspects the predicted bean type and thus does not consider the bean as factory bean. Shouldn't this method check the actual bean type as well or even instead? The current implementation pretty much disables the bean definition being discovered as factory bean as soon as you predict the bean type.