Buggy code:
public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFactory implements Serializable , ConfigurableListableBeanFactory , BeanDefinitionRegistry { private static Class javaxInjectProviderClass = null ; private static final Map < String , Reference < DefaultListableBeanFactory > > serializableFactories = new ConcurrentHashMap < String , Reference < DefaultListableBeanFactory > > ( ) ; private String serializationId ; private boolean allowBeanDefinitionOverriding = true ; private boolean allowEagerClassLoading = true ; private AutowireCandidateResolver autowireCandidateResolver = new SimpleAutowireCandidateResolver ( ) ; private final Map < Class , Object > resolvableDependencies = new HashMap < Class , Object > ( ) ; private final Map < String , BeanDefinition > beanDefinitionMap = new ConcurrentHashMap < String , BeanDefinition > ( ) ; private final List < String > beanDefinitionNames = new ArrayList < String > ( ) ; private boolean configurationFrozen = false ; private String [ ] frozenBeanDefinitionNames ; public DefaultListableBeanFactory ( ) { } public DefaultListableBeanFactory ( BeanFactory parentBeanFactory ) { } public void setSerializationId ( String serializationId ) { } public void setAllowBeanDefinitionOverriding ( boolean allowBeanDefinitionOverriding ) { } public void setAllowEagerClassLoading ( boolean allowEagerClassLoading ) { } public void setAutowireCandidateResolver ( final AutowireCandidateResolver autowireCandidateResolver ) { } public AutowireCandidateResolver getAutowireCandidateResolver ( ) { } @ Override public void copyConfigurationFrom ( ConfigurableBeanFactory otherFactory ) { } public < T > T getBean ( Class < T > requiredType ) throws BeansException { } @ Override public boolean containsBeanDefinition ( String beanName ) { } public int getBeanDefinitionCount ( ) { } public String [ ] getBeanDefinitionNames ( ) { } public String [ ] getBeanNamesForType ( Class type ) { } public String [ ] getBeanNamesForType ( Class type , boolean includeNonSingletons , boolean allowEagerInit ) { } private boolean requiresEagerInitForType ( String factoryBeanName ) { } public < T > Map < String , T > getBeansOfType ( Class < T > type ) throws BeansException { } public < T > Map < String , T > getBeansOfType ( Class < T > type , boolean includeNonSingletons , boolean allowEagerInit ) throws BeansException { } public Map < String , Object > getBeansWithAnnotation ( Class < ? extends Annotation > annotationType ) { } public < A extends Annotation > A findAnnotationOnBean ( String beanName , Class < A > annotationType ) { } public void registerResolvableDependency ( Class < ? > dependencyType , Object autowiredValue ) { } public boolean isAutowireCandidate ( String beanName , DependencyDescriptor descriptor ) throws NoSuchBeanDefinitionException { } protected boolean isAutowireCandidate ( String beanName , RootBeanDefinition mbd , DependencyDescriptor descriptor ) { } @ Override public BeanDefinition getBeanDefinition ( String beanName ) throws NoSuchBeanDefinitionException { } public void freezeConfiguration ( ) { } public boolean isConfigurationFrozen ( ) { } @ Override protected boolean isBeanEligibleForMetadataCaching ( String beanName ) { } public void preInstantiateSingletons ( ) throws BeansException { } public void registerBeanDefinition ( String beanName , BeanDefinition beanDefinition ) throws BeanDefinitionStoreException { } public void removeBeanDefinition ( String beanName ) throws NoSuchBeanDefinitionException { } protected void resetBeanDefinition ( String beanName ) { } @ Override protected boolean allowAliasOverriding ( ) { } public Object resolveDependency ( DependencyDescriptor descriptor , String beanName , Set < String > autowiredBeanNames , TypeConverter typeConverter ) throws BeansException { } protected Object doResolveDependency ( DependencyDescriptor descriptor , Class < ? > type , String beanName , Set < String > autowiredBeanNames , TypeConverter typeConverter ) throws BeansException { Object value = getAutowireCandidateResolver ( ) . getSuggestedValue ( descriptor ) ; if ( value != null ) { if ( value instanceof String ) { String strVal = resolveEmbeddedValue ( ( ( String ) ( value ) ) ) ; <START_BUG> BeanDefinition bd = ( containsBean ( beanName ) ) ? getMergedBeanDefinition ( beanName ) : null ; <END_BUG> value = evaluateBeanDefinitionString ( strVal , bd ) ; } TypeConverter converter = ( typeConverter != null ) ? typeConverter : getTypeConverter ( ) ; return converter . convertIfNecessary ( value , type ) ; } if ( type . isArray ( ) ) { Class componentType = type . getComponentType ( ) ; Map < String , Object > matchingBeans = findAutowireCandidates ( beanName , componentType , descriptor ) ; if ( matchingBeans . isEmpty ( ) ) { if ( descriptor . isRequired ( ) ) { raiseNoSuchBeanDefinitionException ( componentType , ( "array<seq2seq4repair_space>of<seq2seq4repair_space>" + ( componentType . getName ( ) ) ) , descriptor ) ; } return null ; } if ( autowiredBeanNames != null ) { autowiredBeanNames . addAll ( matchingBeans . keySet ( ) ) ; } TypeConverter converter = ( typeConverter != null ) ? typeConverter : getTypeConverter ( ) ; return converter . convertIfNecessary ( matchingBeans . values ( ) , type ) ; } else if ( ( Collection . class . isAssignableFrom ( type ) ) && ( type . isInterface ( ) ) ) { Class elementType = descriptor . getCollectionType ( ) ; if ( elementType == null ) { if ( descriptor . isRequired ( ) ) { throw new FatalBeanException ( ( ( "No<seq2seq4repair_space>element<seq2seq4repair_space>type<seq2seq4repair_space>declared<seq2seq4repair_space>for<seq2seq4repair_space>collection<seq2seq4repair_space>[" + ( type . getName ( ) ) ) + "]" ) ) ; } return null ; } Map < String , Object > matchingBeans = findAutowireCandidates ( beanName , elementType , descriptor ) ; if ( matchingBeans . isEmpty ( ) ) { if ( descriptor . isRequired ( ) ) { raiseNoSuchBeanDefinitionException ( elementType , ( "collection<seq2seq4repair_space>of<seq2seq4repair_space>" + ( elementType . getName ( ) ) ) , descriptor ) ; } return null ; } if ( autowiredBeanNames != null ) { autowiredBeanNames . addAll ( matchingBeans . keySet ( ) ) ; } TypeConverter converter = ( typeConverter != null ) ? typeConverter : getTypeConverter ( ) ; return converter . convertIfNecessary ( matchingBeans . values ( ) , type ) ; } else if ( ( Map . class . isAssignableFrom ( type ) ) && ( type . isInterface ( ) ) ) { Class keyType = descriptor . getMapKeyType ( ) ;

Fix:
BeanDefinition bd = ( ( beanName != null ) && ( containsBean ( beanName ) ) ) ? getMergedBeanDefinition ( beanName ) : null ;