Buggy code:
public final class AutowiredAnnotationBeanPostProcessorTests { @ Test public void testIncompleteBeanDefinition ( ) { } @ Test public void testResourceInjection ( ) { } @ Test public void testExtendedResourceInjection ( ) { } @ Test public void testExtendedResourceInjectionWithOverriding ( ) { DefaultListableBeanFactory bf = new DefaultListableBeanFactory ( ) ; bf . registerResolvableDependency ( BeanFactory . class , bf ) ; AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor ( ) ; bpp . setBeanFactory ( bf ) ; bf . addBeanPostProcessor ( bpp ) ; RootBeanDefinition annotatedBd = new RootBeanDefinition ( AutowiredAnnotationBeanPostProcessorTests . TypedExtendedResourceInjectionBean . class ) ; TestBean tb2 = new TestBean ( ) ; <START_BUG> annotatedBd . getPropertyValues ( ) . addPropertyValue ( "testBean2" , tb2 ) ; <END_BUG> bf . registerBeanDefinition ( "annotatedBean" , annotatedBd ) ; TestBean tb = new TestBean ( ) ; bf . registerSingleton ( "testBean" , tb ) ; NestedTestBean ntb = new NestedTestBean ( ) ; bf . registerSingleton ( "nestedTestBean" , ntb ) ; AutowiredAnnotationBeanPostProcessorTests . TypedExtendedResourceInjectionBean bean = ( ( AutowiredAnnotationBeanPostProcessorTests . TypedExtendedResourceInjectionBean ) ( bf . getBean ( "annotatedBean" ) ) ) ; assertSame ( tb , bean . getTestBean ( ) ) ; assertSame ( tb2 , bean . getTestBean2 ( ) ) ; assertSame ( tb , bean . getTestBean3 ( ) ) ; assertSame ( tb , bean . getTestBean4 ( ) ) ; assertSame ( ntb , bean . getNestedTestBean ( ) ) ; assertSame ( bf , bean . getBeanFactory ( ) ) ; bf . destroySingletons ( ) ; } @ Test public void testExtendedResourceInjectionWithSkippedOverriddenMethods ( ) { } @ Test public void testExtendedResourceInjectionWithAtRequired ( ) { } @ Test public void testOptionalResourceInjection ( ) { } @ Test public void testOptionalCollectionResourceInjection ( ) { } @ Test public void testOptionalCollectionResourceInjectionWithSingleElement ( ) { } @ Test public void testOptionalResourceInjectionWithIncompleteDependencies ( ) { } @ Test public void testOptionalResourceInjectionWithNoDependencies ( ) { } @ Test public void testConstructorResourceInjection ( ) { } @ Test public void testConstructorResourceInjectionWithMultipleCandidates ( ) { } @ Test public void testConstructorResourceInjectionWithMultipleCandidatesAsCollection ( ) { } @ Test public void testConstructorResourceInjectionWithMultipleCandidatesAndFallback ( ) { } @ Test public void testConstructorResourceInjectionWithMultipleCandidatesAndDefaultFallback ( ) { } @ Test public void testConstructorInjectionWithMap ( ) { } @ Test public void testFieldInjectionWithMap ( ) { } @ Test public void testMethodInjectionWithMap ( ) { } @ Test public void testMethodInjectionWithMapAndMultipleMatches ( ) { } @ Test public void testMethodInjectionWithMapAndMultipleMatchesButOnlyOneAutowireCandidate ( ) { } @ Test public void testMethodInjectionWithMapAndNoMatches ( ) { } @ Test public void testObjectFactoryInjection ( ) { } @ Test public void testObjectFactoryQualifierInjection ( ) { } @ Test public void testObjectFactorySerialization ( ) throws Exception { } @ Test public void testCustomAnnotationRequiredFieldResourceInjection ( ) { } @ Test public void testCustomAnnotationRequiredFieldResourceInjectionFailsWhenNoDependencyFound ( ) { } @ Test public void testCustomAnnotationRequiredFieldResourceInjectionFailsWhenMultipleDependenciesFound ( ) { } @ Test public void testCustomAnnotationRequiredMethodResourceInjection ( ) { } @ Test public void testCustomAnnotationRequiredMethodResourceInjectionFailsWhenNoDependencyFound ( ) { } @ Test public void testCustomAnnotationRequiredMethodResourceInjectionFailsWhenMultipleDependenciesFound ( ) { } @ Test public void testCustomAnnotationOptionalFieldResourceInjection ( ) { } @ Test public void testCustomAnnotationOptionalFieldResourceInjectionWhenNoDependencyFound ( ) { } @ Test public void testCustomAnnotationOptionalFieldResourceInjectionWhenMultipleDependenciesFound ( ) { } @ Test public void testCustomAnnotationOptionalMethodResourceInjection ( ) { } @ Test public void testCustomAnnotationOptionalMethodResourceInjectionWhenNoDependencyFound ( ) { } @ Test public void testCustomAnnotationOptionalMethodResourceInjectionWhenMultipleDependenciesFound ( ) { } @ Test public void testBeanAutowiredWithFactoryBean ( ) { } public static class ResourceInjectionBean { @ Autowired ( required = false ) private TestBean testBean ; private TestBean testBean2 ; @ Autowired public void setTestBean2 ( TestBean testBean2 ) { } public TestBean getTestBean ( ) { } public TestBean getTestBean2 ( ) { } } public static class ExtendedResourceInjectionBean < T > extends AutowiredAnnotationBeanPostProcessorTests . ResourceInjectionBean { @ Autowired protected ITestBean testBean3 ; private T nestedTestBean ; private ITestBean testBean4 ; protected BeanFactory beanFactory ; public boolean baseInjected = false ; public ExtendedResourceInjectionBean ( ) { } @ Autowired @ Required public void setTestBean2 ( TestBean testBean2 ) { } @ Autowired private void inject ( ITestBean testBean4 , T nestedTestBean ) { } @ Autowired private void inject ( ITestBean testBean4 ) { } @ Autowired protected void initBeanFactory ( BeanFactory beanFactory ) { } public ITestBean getTestBean3 ( ) { } public ITestBean getTestBean4 ( ) { } public T getNestedTestBean ( ) { } public BeanFactory getBeanFactory ( ) { } } public static class TypedExtendedResourceInjectionBean extends AutowiredAnnotationBeanPostProcessorTests . ExtendedResourceInjectionBean < NestedTestBean > { } public static class OverriddenExtendedResourceInjectionBean extends AutowiredAnnotationBeanPostProcessorTests . ExtendedResourceInjectionBean < NestedTestBean > { public boolean subInjected = false ; @ Override public void setTestBean2 ( TestBean testBean2 ) { } @ Override protected void initBeanFactory ( BeanFactory beanFactory ) { } @ Autowired private void inject ( ITestBean testBean4 ) { } } public static class OptionalResourceInjectionBean extends AutowiredAnnotationBeanPostProcessorTests . ResourceInjectionBean { @ Autowired ( required = false ) protected ITestBean testBean3 ; private IndexedTestBean indexedTestBean ; private NestedTestBean [ ] nestedTestBeans ; @ Autowired ( required = false ) public NestedTestBean [ ] nestedTestBeansField ; private ITestBean testBean4 ; @ Autowired ( required = false ) public void setTestBean2 ( TestBean testBean2 ) { } @ Autowired ( required = false ) private void inject ( ITestBean testBean4 , NestedTestBean [ ] nestedTestBeans , IndexedTestBean indexedTestBean ) { } public ITestBean getTestBean3 ( ) { } public ITestBean getTestBean4 ( ) { } public IndexedTestBean getIndexedTestBean ( ) { } public NestedTestBean [ ] getNestedTestBeans ( ) { } } public static class OptionalCollectionResourceInjectionBean extends AutowiredAnnotationBeanPostProcessorTests . ResourceInjectionBean { @ Autowired ( required = false ) protected ITestBean testBean3 ; private IndexedTestBean indexedTestBean ; private List < NestedTestBean > nestedTestBeans ; public List < NestedTestBean > nestedTestBeansSetter ; @ Autowired ( required = false ) public List < NestedTestBean > nestedTestBeansField ; private ITestBean testBean4 ; @ Autowired ( required = false ) public void setTestBean2 ( TestBean testBean2 ) { }

Fix:
annotatedBd . getPropertyValues ( ) . add ( "testBean2" , tb2 ) ;