diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyUtils.java b/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyUtils.java index fb78503e20..d133c5d9a7 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyUtils.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyUtils.java @@ -21,7 +21,6 @@ import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; import org.springframework.aop.SpringProxy; @@ -119,7 +118,6 @@ public abstract class AopProxyUtils { * @see DecoratingProxy * @see org.springframework.aot.hint.RuntimeHints#proxies() * @see org.springframework.aot.hint.ProxyHints#registerJdkProxy(Class...) - * @see #completeJdkProxyInterfaces(String...) */ public static Class[] completeJdkProxyInterfaces(Class... userInterfaces) { List> completedInterfaces = new ArrayList<>(userInterfaces.length + 3); @@ -135,40 +133,6 @@ public abstract class AopProxyUtils { return completedInterfaces.toArray(Class[]::new); } - /** - * Complete the set of interfaces that are typically required in a JDK dynamic - * proxy generated by Spring AOP. - *

Specifically, {@link SpringProxy}, {@link Advised}, and {@link DecoratingProxy} - * will be appended to the set of user-specified interfaces. - *

This method can be useful when registering - * {@linkplain org.springframework.aot.hint.ProxyHints proxy hints} for Spring's - * AOT support, as demonstrated in the following example which uses this method - * via a {@code static} import. - *

-	 * RuntimeHints hints = ...
-	 * hints.proxies().registerJdkProxy(completeJdkProxyInterfaces("com.example.MyInterface"));
-	 * 
- * @param userInterfaces the set of fully qualified names of user-specified - * interfaces implemented by the component to be proxied - * @return the complete set of fully qualified names of interfaces that the - * proxy should implement - * @since 6.0 - * @see SpringProxy - * @see Advised - * @see DecoratingProxy - * @see org.springframework.aot.hint.RuntimeHints#proxies() - * @see org.springframework.aot.hint.ProxyHints#registerJdkProxy(Class...) - * @see #completeJdkProxyInterfaces(Class...) - */ - public static String[] completeJdkProxyInterfaces(String... userInterfaces) { - List completedInterfaces = new ArrayList<>(userInterfaces.length + 3); - Collections.addAll(completedInterfaces, userInterfaces); - completedInterfaces.add(SpringProxy.class.getName()); - completedInterfaces.add(Advised.class.getName()); - completedInterfaces.add(DecoratingProxy.class.getName()); - return completedInterfaces.toArray(String[]::new); - } - /** * Determine the complete set of interfaces to proxy for the given AOP configuration. *

This will always add the {@link Advised} interface unless the AdvisedSupport's diff --git a/spring-aop/src/test/java/org/springframework/aop/framework/AopProxyUtilsTests.java b/spring-aop/src/test/java/org/springframework/aop/framework/AopProxyUtilsTests.java index adac73e879..783d668645 100644 --- a/spring-aop/src/test/java/org/springframework/aop/framework/AopProxyUtilsTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/framework/AopProxyUtilsTests.java @@ -144,23 +144,6 @@ class AopProxyUtilsTests { ITestBean.class, Comparable.class, SpringProxy.class, Advised.class, DecoratingProxy.class); } - @Test - void completeJdkProxyInterfacesFromSingleClassName() { - String[] jdkProxyInterfaces = AopProxyUtils.completeJdkProxyInterfaces(ITestBean.class.getName()); - assertThat(jdkProxyInterfaces).containsExactly( - ITestBean.class.getName(), SpringProxy.class.getName(), Advised.class.getName(), - DecoratingProxy.class.getName()); - } - - @Test - void completeJdkProxyInterfacesFromMultipleClassNames() { - String[] jdkProxyInterfaces = - AopProxyUtils.completeJdkProxyInterfaces(ITestBean.class.getName(), Comparable.class.getName()); - assertThat(jdkProxyInterfaces).containsExactly( - ITestBean.class.getName(), Comparable.class.getName(), SpringProxy.class.getName(), - Advised.class.getName(), DecoratingProxy.class.getName()); - } - sealed interface SealedInterface { }