If not a bug and intentional just close.

In doing our own static null analysis, we happened across the issue that FactoryBean's getObject method is nullable, but the AbstractFactoryBean's wrapping of that and abstract method of createInstance is non-null.

That's certainly plausible, just seemed a bit odd and wanted to make sure it's not a lurking/long-standing issue that arose from a change to one of them.

I believe they're like this in both 5 and 6.

Comment From: snicoll

This looks like the expected behavior to me. Yes a FactoryBean impl may return a null value but AbstractFactoryBean does not enforce that, which is totally ok. This delegates to createInstance that's not @Nullable.