Skip to content

Commit 49dfcad

Browse files
committed
Remove AopProxyUtils.completeJdkProxyInterfaces(String...)
Since gh-28781 is still open for team discussion, this commit removes the `String...` variant for AopProxyUtils.completeJdkProxyInterfaces. Depending on the outcome of gh-28781, this method may be reintroduced in 6.0 M6. Closes gh-28745
1 parent 7bfcb4c commit 49dfcad

File tree

2 files changed

+0
-53
lines changed

2 files changed

+0
-53
lines changed

Diff for: spring-aop/src/main/java/org/springframework/aop/framework/AopProxyUtils.java

-36
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.lang.reflect.Proxy;
2222
import java.util.ArrayList;
2323
import java.util.Arrays;
24-
import java.util.Collections;
2524
import java.util.List;
2625

2726
import org.springframework.aop.SpringProxy;
@@ -119,7 +118,6 @@ public static Class<?> ultimateTargetClass(Object candidate) {
119118
* @see DecoratingProxy
120119
* @see org.springframework.aot.hint.RuntimeHints#proxies()
121120
* @see org.springframework.aot.hint.ProxyHints#registerJdkProxy(Class...)
122-
* @see #completeJdkProxyInterfaces(String...)
123121
*/
124122
public static Class<?>[] completeJdkProxyInterfaces(Class<?>... userInterfaces) {
125123
List<Class<?>> completedInterfaces = new ArrayList<>(userInterfaces.length + 3);
@@ -135,40 +133,6 @@ public static Class<?>[] completeJdkProxyInterfaces(Class<?>... userInterfaces)
135133
return completedInterfaces.toArray(Class<?>[]::new);
136134
}
137135

138-
/**
139-
* Complete the set of interfaces that are typically required in a JDK dynamic
140-
* proxy generated by Spring AOP.
141-
* <p>Specifically, {@link SpringProxy}, {@link Advised}, and {@link DecoratingProxy}
142-
* will be appended to the set of user-specified interfaces.
143-
* <p>This method can be useful when registering
144-
* {@linkplain org.springframework.aot.hint.ProxyHints proxy hints} for Spring's
145-
* AOT support, as demonstrated in the following example which uses this method
146-
* via a {@code static} import.
147-
* <pre class="code">
148-
* RuntimeHints hints = ...
149-
* hints.proxies().registerJdkProxy(completeJdkProxyInterfaces("com.example.MyInterface"));
150-
* </pre>
151-
* @param userInterfaces the set of fully qualified names of user-specified
152-
* interfaces implemented by the component to be proxied
153-
* @return the complete set of fully qualified names of interfaces that the
154-
* proxy should implement
155-
* @since 6.0
156-
* @see SpringProxy
157-
* @see Advised
158-
* @see DecoratingProxy
159-
* @see org.springframework.aot.hint.RuntimeHints#proxies()
160-
* @see org.springframework.aot.hint.ProxyHints#registerJdkProxy(Class...)
161-
* @see #completeJdkProxyInterfaces(Class...)
162-
*/
163-
public static String[] completeJdkProxyInterfaces(String... userInterfaces) {
164-
List<String> completedInterfaces = new ArrayList<>(userInterfaces.length + 3);
165-
Collections.addAll(completedInterfaces, userInterfaces);
166-
completedInterfaces.add(SpringProxy.class.getName());
167-
completedInterfaces.add(Advised.class.getName());
168-
completedInterfaces.add(DecoratingProxy.class.getName());
169-
return completedInterfaces.toArray(String[]::new);
170-
}
171-
172136
/**
173137
* Determine the complete set of interfaces to proxy for the given AOP configuration.
174138
* <p>This will always add the {@link Advised} interface unless the AdvisedSupport's

Diff for: spring-aop/src/test/java/org/springframework/aop/framework/AopProxyUtilsTests.java

-17
Original file line numberDiff line numberDiff line change
@@ -144,23 +144,6 @@ void completeJdkProxyInterfacesFromMultipleClasses() {
144144
ITestBean.class, Comparable.class, SpringProxy.class, Advised.class, DecoratingProxy.class);
145145
}
146146

147-
@Test
148-
void completeJdkProxyInterfacesFromSingleClassName() {
149-
String[] jdkProxyInterfaces = AopProxyUtils.completeJdkProxyInterfaces(ITestBean.class.getName());
150-
assertThat(jdkProxyInterfaces).containsExactly(
151-
ITestBean.class.getName(), SpringProxy.class.getName(), Advised.class.getName(),
152-
DecoratingProxy.class.getName());
153-
}
154-
155-
@Test
156-
void completeJdkProxyInterfacesFromMultipleClassNames() {
157-
String[] jdkProxyInterfaces =
158-
AopProxyUtils.completeJdkProxyInterfaces(ITestBean.class.getName(), Comparable.class.getName());
159-
assertThat(jdkProxyInterfaces).containsExactly(
160-
ITestBean.class.getName(), Comparable.class.getName(), SpringProxy.class.getName(),
161-
Advised.class.getName(), DecoratingProxy.class.getName());
162-
}
163-
164147

165148
sealed interface SealedInterface {
166149
}

0 commit comments

Comments
 (0)