Skip to content

Commit d2faef4

Browse files
committed
Add comment on DisposableBean use in @configuration
Issue: SPR-7901
1 parent d3678ca commit d2faef4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ private static class DisposableBeanMethodInterceptor implements MethodIntercepto
163163

164164
public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
165165
Enhancer.registerStaticCallbacks(obj.getClass(), null);
166+
// does the actual (non-CGLIB) superclass actually implement DisposableBean?
167+
// if so, call its dispose() method. If not, just exit.
166168
if (DisposableBean.class.isAssignableFrom(obj.getClass().getSuperclass())) {
167169
return proxy.invokeSuper(obj, args);
168170
}

0 commit comments

Comments
 (0)