|
|
@ -55,6 +55,7 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory; |
|
|
|
import org.springframework.beans.factory.support.GenericBeanDefinition; |
|
|
|
import org.springframework.beans.factory.support.GenericBeanDefinition; |
|
|
|
import org.springframework.beans.factory.support.RootBeanDefinition; |
|
|
|
import org.springframework.beans.factory.support.RootBeanDefinition; |
|
|
|
import org.springframework.core.Ordered; |
|
|
|
import org.springframework.core.Ordered; |
|
|
|
|
|
|
|
import org.springframework.core.ResolvableType; |
|
|
|
import org.springframework.core.annotation.AnnotationAwareOrderComparator; |
|
|
|
import org.springframework.core.annotation.AnnotationAwareOrderComparator; |
|
|
|
import org.springframework.core.annotation.Order; |
|
|
|
import org.springframework.core.annotation.Order; |
|
|
|
import org.springframework.tests.sample.beans.ITestBean; |
|
|
|
import org.springframework.tests.sample.beans.ITestBean; |
|
|
@ -1633,6 +1634,8 @@ public class AutowiredAnnotationBeanPostProcessorTests { |
|
|
|
assertSame(1, bean.stringRepositoryMap.size()); |
|
|
|
assertSame(1, bean.stringRepositoryMap.size()); |
|
|
|
assertSame(repo, bean.repositoryMap.get("repo")); |
|
|
|
assertSame(repo, bean.repositoryMap.get("repo")); |
|
|
|
assertSame(repo, bean.stringRepositoryMap.get("repo")); |
|
|
|
assertSame(repo, bean.stringRepositoryMap.get("repo")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertArrayEquals(new String[] {"repo"}, bf.getBeanNamesForType(ResolvableType.forClassWithGenerics(Repository.class, String.class))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
@ -2018,6 +2021,9 @@ public class AutowiredAnnotationBeanPostProcessorTests { |
|
|
|
GenericInterface1Impl bean1 = (GenericInterface1Impl) bf.getBean("bean1"); |
|
|
|
GenericInterface1Impl bean1 = (GenericInterface1Impl) bf.getBean("bean1"); |
|
|
|
GenericInterface2Impl bean2 = (GenericInterface2Impl) bf.getBean("bean2"); |
|
|
|
GenericInterface2Impl bean2 = (GenericInterface2Impl) bf.getBean("bean2"); |
|
|
|
assertSame(bean2, bean1.gi2); |
|
|
|
assertSame(bean2, bean1.gi2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertArrayEquals(new String[] {"bean1"}, bf.getBeanNamesForType(ResolvableType.forClassWithGenerics(GenericInterface1.class, String.class))); |
|
|
|
|
|
|
|
assertArrayEquals(new String[] {"bean2"}, bf.getBeanNamesForType(ResolvableType.forClassWithGenerics(GenericInterface2.class, String.class))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
@ -3076,7 +3082,7 @@ public class AutowiredAnnotationBeanPostProcessorTests { |
|
|
|
|
|
|
|
|
|
|
|
public interface GenericInterface1<T> { |
|
|
|
public interface GenericInterface1<T> { |
|
|
|
|
|
|
|
|
|
|
|
public String doSomethingGeneric(T o); |
|
|
|
String doSomethingGeneric(T o); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|