Skip to content

Commit 0a790c1

Browse files
committed
Rename ConfigurationClassMethod => BeanMethod
1 parent f683f78 commit 0a790c1

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
* @see ConfigurationClassParser
3232
* @see ConfigurationClassBeanDefinitionReader
3333
*/
34-
final class ConfigurationClassMethod {
34+
final class BeanMethod {
3535

3636
private final MethodMetadata metadata;
3737

3838
private final ConfigurationClass configurationClass;
3939

4040

41-
public ConfigurationClassMethod(MethodMetadata metadata, ConfigurationClass configurationClass) {
41+
public BeanMethod(MethodMetadata metadata, ConfigurationClass configurationClass) {
4242
this.metadata = metadata;
4343
this.configurationClass = configurationClass;
4444
}

org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClass.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* @author Chris Beams
4141
* @author Juergen Hoeller
4242
* @since 3.0
43-
* @see ConfigurationClassMethod
43+
* @see BeanMethod
4444
* @see ConfigurationClassParser
4545
*/
4646
final class ConfigurationClass {
@@ -51,7 +51,7 @@ final class ConfigurationClass {
5151

5252
private final Map<String, Class<?>> importedResources = new LinkedHashMap<String, Class<?>>();
5353

54-
private final Set<ConfigurationClassMethod> methods = new LinkedHashSet<ConfigurationClassMethod>();
54+
private final Set<BeanMethod> beanMethods = new LinkedHashSet<BeanMethod>();
5555

5656
private String beanName;
5757

@@ -89,12 +89,12 @@ public String getBeanName() {
8989
return this.beanName;
9090
}
9191

92-
public void addMethod(ConfigurationClassMethod method) {
93-
this.methods.add(method);
92+
public void addBeanMethod(BeanMethod method) {
93+
this.beanMethods.add(method);
9494
}
9595

96-
public Set<ConfigurationClassMethod> getMethods() {
97-
return this.methods;
96+
public Set<BeanMethod> getBeanMethods() {
97+
return this.beanMethods;
9898
}
9999

100100
public void addImportedResource(String importedResource, Class<?> readerClass) {
@@ -110,9 +110,9 @@ public void validate(ProblemReporter problemReporter) {
110110
// @Configuration class may declare two @Bean methods with the same name.
111111
final char hashDelim = '#';
112112
Map<String, Integer> methodNameCounts = new HashMap<String, Integer>();
113-
for (ConfigurationClassMethod method : methods) {
114-
String dClassName = method.getMetadata().getDeclaringClassName();
115-
String methodName = method.getMetadata().getMethodName();
113+
for (BeanMethod beanMethod : beanMethods) {
114+
String dClassName = beanMethod.getMetadata().getDeclaringClassName();
115+
String methodName = beanMethod.getMetadata().getMethodName();
116116
String fqMethodName = dClassName + hashDelim + methodName;
117117
Integer currentCount = methodNameCounts.get(fqMethodName);
118118
int newCount = currentCount != null ? currentCount + 1 : 1;
@@ -134,8 +134,8 @@ public void validate(ProblemReporter problemReporter) {
134134
}
135135
}
136136

137-
for (ConfigurationClassMethod method : this.methods) {
138-
method.validate(problemReporter);
137+
for (BeanMethod beanMethod : this.beanMethods) {
138+
beanMethod.validate(problemReporter);
139139
}
140140
}
141141

org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassBeanDefinitionReader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ private void loadBeanDefinitionsForConfigurationClass(ConfigurationClass configC
139139
AnnotationMetadata metadata = configClass.getMetadata();
140140
processFeatureAnnotations(metadata);
141141
doLoadBeanDefinitionForConfigurationClassIfNecessary(configClass);
142-
for (ConfigurationClassMethod beanMethod : configClass.getMethods()) {
142+
for (BeanMethod beanMethod : configClass.getBeanMethods()) {
143143
loadBeanDefinitionsForBeanMethod(beanMethod);
144144
}
145145
loadBeanDefinitionsFromImportedResources(configClass.getImportedResources());
@@ -200,10 +200,10 @@ private void doLoadBeanDefinitionForConfigurationClassIfNecessary(ConfigurationC
200200
}
201201

202202
/**
203-
* Read a particular {@link ConfigurationClassMethod}, registering bean definitions
203+
* Read a particular {@link BeanMethod}, registering bean definitions
204204
* with the BeanDefinitionRegistry based on its contents.
205205
*/
206-
private void loadBeanDefinitionsForBeanMethod(ConfigurationClassMethod beanMethod) {
206+
private void loadBeanDefinitionsForBeanMethod(BeanMethod beanMethod) {
207207
ConfigurationClass configClass = beanMethod.getConfigurationClass();
208208
MethodMetadata metadata = beanMethod.getMetadata();
209209

org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ protected void doProcessConfigurationClass(ConfigurationClass configClass, Annot
150150
}
151151
}
152152
Set<MethodMetadata> beanMethods = metadata.getAnnotatedMethods(Bean.class.getName());
153-
for (MethodMetadata beanMethod : beanMethods) {
154-
configClass.addMethod(new ConfigurationClassMethod(beanMethod, configClass));
153+
for (MethodMetadata methodMetadata : beanMethods) {
154+
configClass.addBeanMethod(new BeanMethod(methodMetadata, configClass));
155155
}
156156
}
157157

0 commit comments

Comments
 (0)