Buggy code:
public class ConfigurationClassBeanDefinitionReader { private static final String CONFIGURATION_CLASS_FULL = "full" ; private static final String CONFIGURATION_CLASS_LITE = "lite" ; private static final String CONFIGURATION_CLASS_ATTRIBUTE = Conventions . getQualifiedAttributeName ( ConfigurationClassPostProcessor . class , "configurationClass" ) ; private static final Log logger = LogFactory . getLog ( ConfigurationClassBeanDefinitionReader . class ) ; private final BeanDefinitionRegistry registry ; private final SourceExtractor sourceExtractor ; private final ProblemReporter problemReporter ; private final MetadataReaderFactory metadataReaderFactory ; private ResourceLoader resourceLoader ; private SpecificationContext specificationContext ; public ConfigurationClassBeanDefinitionReader ( final BeanDefinitionRegistry registry , SourceExtractor sourceExtractor , ProblemReporter problemReporter , MetadataReaderFactory metadataReaderFactory , ResourceLoader resourceLoader , Environment environment ) { } public void loadBeanDefinitions ( Set < ConfigurationClass > configurationModel ) { } private void loadBeanDefinitionsForConfigurationClass ( ConfigurationClass configClass ) { } private void processFeatureAnnotations ( AnnotationMetadata metadata ) { } private void doLoadBeanDefinitionForConfigurationClassIfNecessary ( ConfigurationClass configClass ) { if ( ( configClass . getBeanName ( ) ) != null ) { return ; } BeanDefinition configBeanDef = new GenericBeanDefinition ( ) ; String className = configClass . getMetadata ( ) . getClassName ( ) ; configBeanDef . setBeanClassName ( className ) ; if ( ConfigurationClassBeanDefinitionReader . checkConfigurationClassCandidate ( configBeanDef , this . metadataReaderFactory ) ) { <START_BUG> String configBeanName = BeanDefinitionReaderUtils . registerWithGeneratedName ( configBeanDef , this . registry ) ; <END_BUG> configClass . setBeanName ( configBeanName ) ; if ( ConfigurationClassBeanDefinitionReader . logger . isDebugEnabled ( ) ) { ConfigurationClassBeanDefinitionReader . logger . debug ( String . format ( "Registered<seq2seq4repair_space>bean<seq2seq4repair_space>definition<seq2seq4repair_space>for<seq2seq4repair_space>imported<seq2seq4repair_space>@Configuration<seq2seq4repair_space>class<seq2seq4repair_space>%s" , configBeanName ) ) ; } } else { try { MetadataReader reader = this . metadataReaderFactory . getMetadataReader ( className ) ; AnnotationMetadata metadata = reader . getAnnotationMetadata ( ) ; this . problemReporter . error ( new ConfigurationClassBeanDefinitionReader . InvalidConfigurationImportProblem ( className , reader . getResource ( ) , metadata ) ) ; } catch ( IOException ex ) { throw new IllegalStateException ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>MetadataReader<seq2seq4repair_space>for<seq2seq4repair_space>class<seq2seq4repair_space>" + className ) ) ; } } } private void loadBeanDefinitionsForBeanMethod ( ConfigurationClassMethod beanMethod ) { } private void loadBeanDefinitionsFromImportedResources ( Map < String , Class < ? > > importedResources ) { } public static boolean checkConfigurationClassCandidate ( BeanDefinition beanDef , MetadataReaderFactory metadataReaderFactory ) { } public static boolean isFullConfigurationClass ( BeanDefinition beanDef ) { } @ SuppressWarnings ( "serial" ) private static class ConfigurationClassBeanDefinition extends RootBeanDefinition implements AnnotatedBeanDefinition { private AnnotationMetadata annotationMetadata ; public ConfigurationClassBeanDefinition ( ConfigurationClass configClass ) { } private ConfigurationClassBeanDefinition ( ConfigurationClassBeanDefinitionReader . ConfigurationClassBeanDefinition original ) { } public AnnotationMetadata getMetadata ( ) { } @ Override public boolean isFactoryMethod ( Method candidate ) { } @ Override public ConfigurationClassBeanDefinitionReader . ConfigurationClassBeanDefinition cloneBeanDefinition ( ) { } } private static class InvalidConfigurationImportProblem extends Problem { public InvalidConfigurationImportProblem ( String className , Resource resource , AnnotationMetadata metadata ) { } } }

Fix:
String configBeanName = BeanDefinitionReaderUtils . registerWithGeneratedName ( ( ( AbstractBeanDefinition ) ( configBeanDef ) ) , this . registry ) ;