Skip to content

Commit 118d147

Browse files
committed
Ignore (Auto)Closeable for interface-based proxy decisions
Issue: SPR-15779
1 parent 13080f0 commit 118d147

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spring-aop/src/main/java/org/springframework/aop/framework/ProxyProcessorSupport.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package org.springframework.aop.framework;
1818

19+
import java.io.Closeable;
20+
1921
import org.springframework.beans.factory.Aware;
2022
import org.springframework.beans.factory.BeanClassLoaderAware;
2123
import org.springframework.beans.factory.DisposableBean;
@@ -129,8 +131,8 @@ protected void evaluateProxyInterfaces(Class<?> beanClass, ProxyFactory proxyFac
129131
* @return whether the given interface is just a container callback
130132
*/
131133
protected boolean isConfigurationCallbackInterface(Class<?> ifc) {
132-
return (InitializingBean.class == ifc || DisposableBean.class == ifc ||
133-
ObjectUtils.containsElement(ifc.getInterfaces(), Aware.class));
134+
return (InitializingBean.class == ifc || DisposableBean.class == ifc || Closeable.class == ifc ||
135+
AutoCloseable.class == ifc || ObjectUtils.containsElement(ifc.getInterfaces(), Aware.class));
134136
}
135137

136138
/**

0 commit comments

Comments
 (0)