FactoryBean.OBJECT_TYPE_ATTRIBUTE should either be a Class or a ResolvableType. It should not check if the attribute is a String. As of Spring Framework 6.1, this throws an exception anyway.
Comment From: wilkinsona
Reverted temporarily as not checking String values causes a failure in smoketest.data.jpa.SpyBeanSampleDataJpaApplicationTests. We should be able to re-apply the change once https://github.com/spring-projects/spring-data-commons/issues/2891 has been fixed and we've switched to Spring Data snapshots.
Comment From: snicoll
As it turns out, stopping reading the String attribute means that we request the type to the container and it doesn't find the repository, while it should have. This is being investigated in https://github.com/spring-projects/spring-framework/issues/30987