From 118d1470fdaf65f4f8ef2dff5c2212f0ab2fd607 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 19 Jul 2017 22:40:45 +0200 Subject: [PATCH] Ignore (Auto)Closeable for interface-based proxy decisions Issue: SPR-15779 --- .../aop/framework/ProxyProcessorSupport.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/ProxyProcessorSupport.java b/spring-aop/src/main/java/org/springframework/aop/framework/ProxyProcessorSupport.java index 76e8887015..1bcb797896 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/ProxyProcessorSupport.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/ProxyProcessorSupport.java @@ -16,6 +16,8 @@ package org.springframework.aop.framework; +import java.io.Closeable; + import org.springframework.beans.factory.Aware; import org.springframework.beans.factory.BeanClassLoaderAware; import org.springframework.beans.factory.DisposableBean; @@ -129,8 +131,8 @@ public class ProxyProcessorSupport extends ProxyConfig implements Ordered, BeanC * @return whether the given interface is just a container callback */ protected boolean isConfigurationCallbackInterface(Class ifc) { - return (InitializingBean.class == ifc || DisposableBean.class == ifc || - ObjectUtils.containsElement(ifc.getInterfaces(), Aware.class)); + return (InitializingBean.class == ifc || DisposableBean.class == ifc || Closeable.class == ifc || + AutoCloseable.class == ifc || ObjectUtils.containsElement(ifc.getInterfaces(), Aware.class)); } /**