Buggy code:
class ConfigurationClassParser { private final MetadataReaderFactory metadataReaderFactory ; private final ProblemReporter problemReporter ; private final ConfigurationClassParser . ImportStack importStack = new ConfigurationClassParser . ImportStack ( ) ; private final Set < String > knownSuperclasses = new LinkedHashSet < String > ( ) ; private final Set < ConfigurationClass > configurationClasses = new LinkedHashSet < ConfigurationClass > ( ) ; private final Stack < PropertySource < ? > > propertySources = new Stack < PropertySource < ? > > ( ) ; private final Environment environment ; private final ResourceLoader resourceLoader ; private final BeanDefinitionRegistry registry ; private final ComponentScanAnnotationParser componentScanParser ; public ConfigurationClassParser ( MetadataReaderFactory metadataReaderFactory , ProblemReporter problemReporter , Environment environment , ResourceLoader resourceLoader , BeanNameGenerator beanNameGenerator , BeanDefinitionRegistry registry ) { } public void parse ( String className , String beanName ) throws IOException { } public void parse ( Class < ? > clazz , String beanName ) throws IOException { } protected void processConfigurationClass ( ConfigurationClass configClass ) throws IOException { } protected AnnotationMetadata doProcessConfigurationClass ( ConfigurationClass configClass , AnnotationMetadata metadata ) throws IOException { for ( String memberClassName : metadata . getMemberClassNames ( ) ) { MetadataReader reader = this . metadataReaderFactory . getMetadataReader ( memberClassName ) ; AnnotationMetadata memberClassMetadata = reader . getAnnotationMetadata ( ) ; if ( ConfigurationClassUtils . isConfigurationCandidate ( memberClassMetadata ) ) { processConfigurationClass ( new ConfigurationClass ( reader , true ) ) ; } } AnnotationAttributes propertySource = attributesFor ( metadata , PropertySource . class ) ; if ( propertySource != null ) { String name = propertySource . getString ( "name" ) ; String [ ] locations = propertySource . getStringArray ( "value" ) ; int nLocations = locations . length ; if ( nLocations == 0 ) { throw new IllegalArgumentException ( "At<seq2seq4repair_space>least<seq2seq4repair_space>one<seq2seq4repair_space>@PropertySource(value)<seq2seq4repair_space>location<seq2seq4repair_space>is<seq2seq4repair_space>required" ) ; } for ( int i = 0 ; i < nLocations ; i ++ ) { <START_BUG> locations [ 0 ] = this . environment . resolveRequiredPlaceholders ( locations [ 0 ] ) ; <END_BUG> } ClassLoader classLoader = this . resourceLoader . getClassLoader ( ) ; if ( ! ( StringUtils . hasText ( name ) ) ) { for ( String location : locations ) { this . propertySources . push ( new ResourcePropertySource ( location , classLoader ) ) ; } } else { if ( nLocations == 1 ) { this . propertySources . push ( new ResourcePropertySource ( name , locations [ 0 ] , classLoader ) ) ; } else { CompositePropertySource ps = new CompositePropertySource ( name ) ; for ( String location : locations ) { ps . addPropertySource ( new ResourcePropertySource ( location , classLoader ) ) ; } this . propertySources . push ( ps ) ; } } } AnnotationAttributes componentScan = attributesFor ( metadata , ComponentScan . class ) ; if ( componentScan != null ) { Set < BeanDefinitionHolder > scannedBeanDefinitions = this . componentScanParser . parse ( componentScan ) ; for ( BeanDefinitionHolder holder : scannedBeanDefinitions ) { if ( ConfigurationClassUtils . checkConfigurationClassCandidate ( holder . getBeanDefinition ( ) , this . metadataReaderFactory ) ) { this . parse ( holder . getBeanDefinition ( ) . getBeanClassName ( ) , holder . getBeanName ( ) ) ; } } } List < AnnotationAttributes > imports = findAllAnnotationAttributes ( Import . class , metadata . getClassName ( ) , true ) ; for ( AnnotationAttributes importAnno : imports ) { processImport ( configClass , importAnno . getStringArray ( "value" ) , true ) ; } if ( metadata . isAnnotated ( ImportResource . class . getName ( ) ) ) { AnnotationAttributes importResource = attributesFor ( metadata , ImportResource . class ) ; String [ ] resources = importResource . getStringArray ( "value" ) ; Class < ? extends BeanDefinitionReader > readerClass = importResource . getClass ( "reader" ) ; for ( String resource : resources ) { configClass . addImportedResource ( resource , readerClass ) ; } } Set < MethodMetadata > beanMethods = metadata . getAnnotatedMethods ( Bean . class . getName ( ) ) ; for ( MethodMetadata methodMetadata : beanMethods ) { configClass . addBeanMethod ( new BeanMethod ( methodMetadata , configClass ) ) ; } if ( metadata . hasSuperClass ( ) ) { String superclass = metadata . getSuperClassName ( ) ; if ( this . knownSuperclasses . add ( superclass ) ) { if ( metadata instanceof StandardAnnotationMetadata ) { Class < ? > clazz = ( ( StandardAnnotationMetadata ) ( metadata ) ) . getIntrospectedClass ( ) ; return new StandardAnnotationMetadata ( clazz . getSuperclass ( ) , true ) ; } else { MetadataReader reader = this . metadataReaderFactory . getMetadataReader ( superclass ) ; return reader . getAnnotationMetadata ( ) ; } } } return null ; } private List < AnnotationAttributes > findAllAnnotationAttributes ( Class < ? extends Annotation > targetAnnotation , String annotatedClassName , boolean classValuesAsString ) throws IOException { } private void processImport ( ConfigurationClass configClass , String [ ] classesToImport , boolean checkForCircularImports ) throws IOException { } public void validate ( ) { } public Set < ConfigurationClass > getConfigurationClasses ( ) { } public Stack < PropertySource < ? > > getPropertySources ( ) { } public ConfigurationClassParser . ImportRegistry getImportRegistry ( ) { } interface ImportRegistry { String getImportingClassFor ( String importedClass ) { } } @ SuppressWarnings ( "serial" ) private static class ImportStack extends Stack < ConfigurationClass > implements ConfigurationClassParser . ImportRegistry { private Map < String , String > imports = new HashMap < String , String > ( ) ; public String getImportingClassFor ( String importedClass ) { } public void registerImport ( String importingClass , String importedClass ) { } @ Override public boolean contains ( Object elem ) { } @ Override public String toString ( ) { } } private static class CircularImportProblem extends Problem { public CircularImportProblem ( ConfigurationClass attemptedImport , Stack < ConfigurationClass > importStack , AnnotationMetadata metadata ) { } } }

Fix:
locations [ i ] = this . environment . resolveRequiredPlaceholders ( locations [ i ] ) ;