Removed unused fields from ConfigurationClassBeanDefinitionReader
Issue: SPR-11740 Issue: SPR-13280
This commit is contained in:
@@ -35,7 +35,6 @@ import org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostPr
|
|||||||
import org.springframework.beans.factory.config.BeanDefinition;
|
import org.springframework.beans.factory.config.BeanDefinition;
|
||||||
import org.springframework.beans.factory.config.BeanDefinitionHolder;
|
import org.springframework.beans.factory.config.BeanDefinitionHolder;
|
||||||
import org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader;
|
import org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader;
|
||||||
import org.springframework.beans.factory.parsing.ProblemReporter;
|
|
||||||
import org.springframework.beans.factory.parsing.SourceExtractor;
|
import org.springframework.beans.factory.parsing.SourceExtractor;
|
||||||
import org.springframework.beans.factory.support.AbstractBeanDefinitionReader;
|
import org.springframework.beans.factory.support.AbstractBeanDefinitionReader;
|
||||||
import org.springframework.beans.factory.support.BeanDefinitionReader;
|
import org.springframework.beans.factory.support.BeanDefinitionReader;
|
||||||
@@ -51,7 +50,6 @@ import org.springframework.core.io.Resource;
|
|||||||
import org.springframework.core.io.ResourceLoader;
|
import org.springframework.core.io.ResourceLoader;
|
||||||
import org.springframework.core.type.AnnotationMetadata;
|
import org.springframework.core.type.AnnotationMetadata;
|
||||||
import org.springframework.core.type.MethodMetadata;
|
import org.springframework.core.type.MethodMetadata;
|
||||||
import org.springframework.core.type.classreading.MetadataReaderFactory;
|
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -79,10 +77,6 @@ class ConfigurationClassBeanDefinitionReader {
|
|||||||
|
|
||||||
private final SourceExtractor sourceExtractor;
|
private final SourceExtractor sourceExtractor;
|
||||||
|
|
||||||
private final ProblemReporter problemReporter;
|
|
||||||
|
|
||||||
private final MetadataReaderFactory metadataReaderFactory;
|
|
||||||
|
|
||||||
private final ResourceLoader resourceLoader;
|
private final ResourceLoader resourceLoader;
|
||||||
|
|
||||||
private final Environment environment;
|
private final Environment environment;
|
||||||
@@ -99,14 +93,11 @@ class ConfigurationClassBeanDefinitionReader {
|
|||||||
* to populate the given {@link BeanDefinitionRegistry}.
|
* to populate the given {@link BeanDefinitionRegistry}.
|
||||||
*/
|
*/
|
||||||
ConfigurationClassBeanDefinitionReader(BeanDefinitionRegistry registry, SourceExtractor sourceExtractor,
|
ConfigurationClassBeanDefinitionReader(BeanDefinitionRegistry registry, SourceExtractor sourceExtractor,
|
||||||
ProblemReporter problemReporter, MetadataReaderFactory metadataReaderFactory,
|
|
||||||
ResourceLoader resourceLoader, Environment environment, BeanNameGenerator importBeanNameGenerator,
|
ResourceLoader resourceLoader, Environment environment, BeanNameGenerator importBeanNameGenerator,
|
||||||
ImportRegistry importRegistry) {
|
ImportRegistry importRegistry) {
|
||||||
|
|
||||||
this.registry = registry;
|
this.registry = registry;
|
||||||
this.sourceExtractor = sourceExtractor;
|
this.sourceExtractor = sourceExtractor;
|
||||||
this.problemReporter = problemReporter;
|
|
||||||
this.metadataReaderFactory = metadataReaderFactory;
|
|
||||||
this.resourceLoader = resourceLoader;
|
this.resourceLoader = resourceLoader;
|
||||||
this.environment = environment;
|
this.environment = environment;
|
||||||
this.importBeanNameGenerator = importBeanNameGenerator;
|
this.importBeanNameGenerator = importBeanNameGenerator;
|
||||||
@@ -243,8 +234,6 @@ class ConfigurationClassBeanDefinitionReader {
|
|||||||
|
|
||||||
// Consider scoping
|
// Consider scoping
|
||||||
ScopedProxyMode proxyMode = ScopedProxyMode.NO;
|
ScopedProxyMode proxyMode = ScopedProxyMode.NO;
|
||||||
// TODO [SPR-13280] Determine why type is hard coded to org.springframework.context.annotation.Scope,
|
|
||||||
// since AnnotationScopeMetadataResolver supports a custom scope annotation type.
|
|
||||||
AnnotationAttributes attributes = AnnotationConfigUtils.attributesFor(metadata, Scope.class);
|
AnnotationAttributes attributes = AnnotationConfigUtils.attributesFor(metadata, Scope.class);
|
||||||
if (attributes != null) {
|
if (attributes != null) {
|
||||||
beanDef.setScope(attributes.getAliasedString("value", Scope.class, configClass.getResource()));
|
beanDef.setScope(attributes.getAliasedString("value", Scope.class, configClass.getResource()));
|
||||||
|
|||||||
@@ -326,8 +326,8 @@ public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPo
|
|||||||
|
|
||||||
// Read the model and create bean definitions based on its content
|
// Read the model and create bean definitions based on its content
|
||||||
if (this.reader == null) {
|
if (this.reader == null) {
|
||||||
this.reader = new ConfigurationClassBeanDefinitionReader(registry, this.sourceExtractor,
|
this.reader = new ConfigurationClassBeanDefinitionReader(
|
||||||
this.problemReporter, this.metadataReaderFactory, this.resourceLoader, this.environment,
|
registry, this.sourceExtractor, this.resourceLoader, this.environment,
|
||||||
this.importBeanNameGenerator, parser.getImportRegistry());
|
this.importBeanNameGenerator, parser.getImportRegistry());
|
||||||
}
|
}
|
||||||
this.reader.loadBeanDefinitions(configClasses);
|
this.reader.loadBeanDefinitions(configClasses);
|
||||||
|
|||||||
Reference in New Issue
Block a user