Buggy code:
public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport implements ConfigurableBeanFactory { private BeanFactory parentBeanFactory ; private ClassLoader beanClassLoader = ClassUtils . getDefaultClassLoader ( ) ; private ClassLoader tempClassLoader ; private boolean cacheBeanMetadata = true ; private BeanExpressionResolver beanExpressionResolver ; private ConversionService conversionService ; private final Set < PropertyEditorRegistrar > propertyEditorRegistrars = new LinkedHashSet < PropertyEditorRegistrar > ( 4 ) ; private TypeConverter typeConverter ; private final Map < Class , Class < ? extends PropertyEditor > > customEditors = new HashMap < Class , Class < ? extends PropertyEditor > > ( 4 ) ; private final List < StringValueResolver > embeddedValueResolvers = new LinkedList < StringValueResolver > ( ) ; private final List < BeanPostProcessor > beanPostProcessors = new ArrayList < BeanPostProcessor > ( ) ; private boolean hasInstantiationAwareBeanPostProcessors ; private boolean hasDestructionAwareBeanPostProcessors ; private final Map < String , Scope > scopes = new HashMap < String , Scope > ( ) ; private SecurityContextProvider securityContextProvider ; private final Map < String , RootBeanDefinition > mergedBeanDefinitions = new ConcurrentHashMap < String , RootBeanDefinition > ( ) ; private final Set < String > alreadyCreated = Collections . synchronizedSet ( new HashSet < String > ( ) ) ; private final ThreadLocal < Object > prototypesCurrentlyInCreation = new org . springframework . core . NamedThreadLocal < Object > ( "Prototype<seq2seq4repair_space>beans<seq2seq4repair_space>currently<seq2seq4repair_space>in<seq2seq4repair_space>creation" ) ; public AbstractBeanFactory ( ) { } public AbstractBeanFactory ( BeanFactory parentBeanFactory ) { } public Object getBean ( String name ) throws BeansException { } public < T > T getBean ( String name , Class < T > requiredType ) throws BeansException { } public Object getBean ( String name , Object ... args ) throws BeansException { } public < T > T getBean ( String name , Class < T > requiredType , Object ... args ) throws BeansException { } @ SuppressWarnings ( "unchecked" ) protected < T > T doGetBean ( final String name , final Class < T > requiredType , final Object [ ] args , boolean typeCheckOnly ) throws BeansException { } public boolean containsBean ( String name ) { } public boolean isSingleton ( String name ) throws NoSuchBeanDefinitionException { } public boolean isPrototype ( String name ) throws NoSuchBeanDefinitionException { } public boolean isTypeMatch ( String name , Class targetType ) throws NoSuchBeanDefinitionException { String beanName = transformedBeanName ( name ) ; Class typeToMatch = ( targetType != null ) ? targetType : Object . class ; Object beanInstance = getSingleton ( beanName , false ) ; if ( beanInstance != null ) { if ( beanInstance instanceof FactoryBean ) { if ( ! ( BeanFactoryUtils . isFactoryDereference ( name ) ) ) { Class type = getTypeForFactoryBean ( ( ( FactoryBean ) ( beanInstance ) ) ) ; return ( type != null ) && ( typeToMatch . isAssignableFrom ( type ) ) ; } else { return typeToMatch . isAssignableFrom ( beanInstance . getClass ( ) ) ; } } else { return ( ! ( BeanFactoryUtils . isFactoryDereference ( name ) ) ) && ( typeToMatch . isAssignableFrom ( beanInstance . getClass ( ) ) ) ; } } else { BeanFactory parentBeanFactory = getParentBeanFactory ( ) ; if ( ( parentBeanFactory != null ) && ( ! ( containsBeanDefinition ( beanName ) ) ) ) { return parentBeanFactory . isTypeMatch ( originalBeanName ( name ) , targetType ) ; } RootBeanDefinition mbd = getMergedLocalBeanDefinition ( beanName ) ; BeanDefinitionHolder dbd = mbd . getDecoratedDefinition ( ) ; <START_BUG> if ( dbd != null ) { <END_BUG> RootBeanDefinition tbd = getMergedBeanDefinition ( dbd . getBeanName ( ) , dbd . getBeanDefinition ( ) , mbd ) ; Class targetClass = predictBeanType ( dbd . getBeanName ( ) , tbd , FactoryBean . class , typeToMatch ) ; if ( ( targetClass != null ) && ( ! ( FactoryBean . class . isAssignableFrom ( targetClass ) ) ) ) { return typeToMatch . isAssignableFrom ( targetClass ) ; } } Class beanClass = predictBeanType ( beanName , mbd , FactoryBean . class , typeToMatch ) ; if ( beanClass == null ) { return false ; } if ( FactoryBean . class . isAssignableFrom ( beanClass ) ) { if ( ! ( BeanFactoryUtils . isFactoryDereference ( name ) ) ) { Class type = getTypeForFactoryBean ( beanName , mbd ) ; return ( type != null ) && ( typeToMatch . isAssignableFrom ( type ) ) ; } else { return typeToMatch . isAssignableFrom ( beanClass ) ; } } else { return ( ! ( BeanFactoryUtils . isFactoryDereference ( name ) ) ) && ( typeToMatch . isAssignableFrom ( beanClass ) ) ; } } } public Class < ? > getType ( String name ) throws NoSuchBeanDefinitionException { } @ Override public String [ ] getAliases ( String name ) { } public BeanFactory getParentBeanFactory ( ) { } public boolean containsLocalBean ( String name ) { } public void setParentBeanFactory ( BeanFactory parentBeanFactory ) { } public void setBeanClassLoader ( ClassLoader beanClassLoader ) { } public ClassLoader getBeanClassLoader ( ) { } public void setTempClassLoader ( ClassLoader tempClassLoader ) { } public ClassLoader getTempClassLoader ( ) { } public void setCacheBeanMetadata ( boolean cacheBeanMetadata ) { } public boolean isCacheBeanMetadata ( ) { } public void setBeanExpressionResolver ( BeanExpressionResolver resolver ) { } public BeanExpressionResolver getBeanExpressionResolver ( ) { } public void setConversionService ( ConversionService conversionService ) { } public ConversionService getConversionService ( ) { } public void addPropertyEditorRegistrar ( PropertyEditorRegistrar registrar ) { } public Set < PropertyEditorRegistrar > getPropertyEditorRegistrars ( ) { } public void registerCustomEditor ( Class requiredType , Class < ? extends PropertyEditor > propertyEditorClass ) { } public void copyRegisteredEditorsTo ( PropertyEditorRegistry registry ) { } public Map < Class , Class < ? extends PropertyEditor > > getCustomEditors ( ) { } public void setTypeConverter ( TypeConverter typeConverter ) { } protected TypeConverter getCustomTypeConverter ( ) { } public TypeConverter getTypeConverter ( ) { }

Fix:
if ( ( dbd != null ) && ( ! ( BeanFactoryUtils . isFactoryDereference ( name ) ) ) ) {