Open
Description
Related to GH-34669, but it requires the bean name matched first, and throw BeanNotOfRequiredTypeException
if the bean type doesn't match required type from type reference.
Take codes in Spring Batch for example:
@SuppressWarnings("unchecked")
ItemReader<CustomerCredit> outputReader = (ItemReader<CustomerCredit>) applicationContext
.getBean("outputTestReader");
I'd like it could be rewrite to:
ItemReader<CustomerCredit> outputReader = applicationContext.getBean("outputTestReader", new ParameterizedTypeReference<>() {});