Skip to content

Commit c3d74b4

Browse files
committed
Polishing
1 parent 61ab40c commit c3d74b4

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,13 @@
4040
import org.springframework.util.Assert;
4141

4242
/**
43-
* Enhances {@link Configuration} classes by generating a CGLIB subclass capable of
44-
* interacting with the Spring container to respect bean semantics.
43+
* Enhances {@link Configuration} classes by generating a CGLIB subclass which
44+
* interacts with the Spring container to respect bean scoping semantics for
45+
* {@code @Bean} methods. Each such {@code @Bean} method will be overridden in
46+
* the generated subclass, only delegating to the actual {@code @Bean} method
47+
* implementation if the container actually requests the construction of a new
48+
* instance. Otherwise, a call to such an {@code @Bean} method serves as a
49+
* reference back to the container, obtaining the corresponding bean by name.
4550
*
4651
* @author Chris Beams
4752
* @author Juergen Hoeller
@@ -104,7 +109,7 @@ public Class<?> enhance(Class<?> configClass) {
104109
private Enhancer newEnhancer(Class<?> superclass) {
105110
Enhancer enhancer = new Enhancer();
106111
enhancer.setSuperclass(superclass);
107-
enhancer.setInterfaces(new Class<?>[]{EnhancedConfiguration.class});
112+
enhancer.setInterfaces(new Class<?>[] {EnhancedConfiguration.class});
108113
enhancer.setUseFactory(false);
109114
enhancer.setNamingPolicy(SpringNamingPolicy.INSTANCE);
110115
enhancer.setCallbackFilter(CALLBACK_FILTER);

0 commit comments

Comments
 (0)