Skip to content

Commit 096670f

Browse files
committed
Merge branch '6.2.x'
# Conflicts: # framework-platform/framework-platform.gradle # spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassBeanDefinitionReader.java
2 parents 1145054 + 2180783 commit 096670f

File tree

6 files changed

+13
-5
lines changed

6 files changed

+13
-5
lines changed

framework-platform/framework-platform.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies {
3030
api("com.github.librepdf:openpdf:1.3.43")
3131
api("com.google.code.findbugs:findbugs:3.0.1")
3232
api("com.google.code.findbugs:jsr305:3.0.2")
33-
api("com.google.code.gson:gson:2.13.0")
33+
api("com.google.code.gson:gson:2.13.1")
3434
api("com.google.protobuf:protobuf-java-util:4.30.2")
3535
api("com.h2database:h2:2.3.232")
3636
api("com.jayway.jsonpath:json-path:2.9.0")

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ final class ConfigurationClass {
131131
* @param metadata the metadata for the underlying class to represent
132132
* @param beanName name of the {@code @Configuration} class bean
133133
* @param scanned whether the underlying class has been registered through a scan
134+
* @since 6.2
134135
*/
135136
ConfigurationClass(AnnotationMetadata metadata, String beanName, boolean scanned) {
136137
Assert.notNull(beanName, "Bean name must not be null");

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,14 @@ private void loadBeanDefinitionsForBeanMethod(BeanMethod beanMethod) {
195195
AnnotationAttributes bean = AnnotationConfigUtils.attributesFor(metadata, Bean.class);
196196
Assert.state(bean != null, "No @Bean annotation attributes");
197197

198-
// Consider name and any aliases
198+
// Consider name and any aliases.
199199
String[] explicitNames = bean.getStringArray("name");
200200
String beanName;
201201
String localBeanName;
202202
if (explicitNames.length > 0 && StringUtils.hasText(explicitNames[0])) {
203203
beanName = explicitNames[0];
204204
localBeanName = beanName;
205-
// Register aliases even when overridden below
205+
// Register aliases even when overridden below.
206206
for (int i = 1; i < explicitNames.length; i++) {
207207
this.registry.registerAlias(beanName, explicitNames[i]);
208208
}

spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationBeanNameTests.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ void registerOuterConfig_withBeanNameGenerator() {
6464
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
6565
ctx.setBeanNameGenerator(new AnnotationBeanNameGenerator() {
6666
@Override
67-
public String generateBeanName(
68-
BeanDefinition definition, BeanDefinitionRegistry registry) {
67+
public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
6968
return "custom-" + super.generateBeanName(definition, registry);
7069
}
7170
});
@@ -78,17 +77,22 @@ public String generateBeanName(
7877
ctx.close();
7978
}
8079

80+
8181
@Configuration("outer")
8282
@Import(C.class)
8383
static class A {
84+
8485
@Component("nested")
8586
static class B {
87+
8688
@Bean public String nestedBean() { return ""; }
8789
}
8890
}
8991

92+
9093
@Configuration("imported")
9194
static class C {
95+
9296
@Bean public String s() { return "s"; }
9397
}
9498

spring-context/src/test/java/org/springframework/context/annotation6/ComponentForScanning.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@
2020

2121
@Component
2222
public class ComponentForScanning {
23+
2324
}

spring-context/src/test/java/org/springframework/context/annotation6/ConfigForScanning.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222

2323
@Configuration
2424
public class ConfigForScanning {
25+
2526
@Bean
2627
public TestBean testBean() {
2728
return new TestBean();
2829
}
30+
2931
}

0 commit comments

Comments
 (0)