In my project, I am trying to migrate all usages of
Foo foo = (Foo) beanFactory.getBean(\"name\");
into
Foo foo = beanFactory.
This problem is now solved in Spring with the resolution of SPR-6870. See the resolution comments there for details. The fix is available as of versions 3.2.0.RELEASE and 3.1.2.