Skip to content

Commit d8003e3

Browse files
committed
Revert "Introduce ProxyHints.registerJdkProxy(String...)"
This reverses commit b560c10. See gh-28781
1 parent 49dfcad commit d8003e3

File tree

3 files changed

+2
-42
lines changed

3 files changed

+2
-42
lines changed

spring-core/src/main/java/org/springframework/aot/hint/JdkProxyHint.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
*
3030
* @author Stephane Nicoll
3131
* @author Brian Clozel
32-
* @author Sam Brannen
3332
* @since 6.0
3433
*/
3534
public final class JdkProxyHint implements ConditionalHint {
@@ -131,17 +130,6 @@ public Builder proxiedInterfaces(Class<?>... proxiedInterfaces) {
131130
return this;
132131
}
133132

134-
/**
135-
* Add the specified interfaces that the proxy should implement.
136-
* @param proxiedInterfaces the fully qualified class names of interfaces
137-
* the proxy should implement
138-
* @return {@code this}, to facilitate method chaining
139-
*/
140-
public Builder proxiedInterfaces(String... proxiedInterfaces) {
141-
this.proxiedInterfaces.addAll(toTypeReferences(proxiedInterfaces));
142-
return this;
143-
}
144-
145133
/**
146134
* Make this hint conditional on the fact that the specified type
147135
* can be resolved.
@@ -171,10 +159,6 @@ private static List<TypeReference> toTypeReferences(Class<?>... proxiedInterface
171159
return Arrays.stream(proxiedInterfaces).map(TypeReference::of).toList();
172160
}
173161

174-
private static List<TypeReference> toTypeReferences(String... proxiedInterfaces) {
175-
return Arrays.stream(proxiedInterfaces).map(TypeReference::of).toList();
176-
}
177-
178162
}
179163

180164
}

spring-core/src/main/java/org/springframework/aot/hint/ProxyHints.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
* Gather the need for using proxies at runtime.
2828
*
2929
* @author Stephane Nicoll
30-
* @author Sam Brannen
3130
* @since 6.0
3231
*/
3332
public class ProxyHints {
@@ -91,21 +90,6 @@ public ProxyHints registerJdkProxy(Class<?>... proxiedInterfaces) {
9190
jdkProxyHint.proxiedInterfaces(proxiedInterfaces));
9291
}
9392

94-
/**
95-
* Register that a JDK proxy implementing the specified interfaces is
96-
* required.
97-
* <p>When registering a JDK proxy for Spring AOP, consider using
98-
* {@link org.springframework.aop.framework.AopProxyUtils#completeJdkProxyInterfaces(String...)
99-
* AopProxyUtils.completeJdkProxyInterfaces()} for convenience.
100-
* @param proxiedInterfaces the fully qualified class names of interfaces the
101-
* proxy should implement
102-
* @return {@code this}, to facilitate method chaining
103-
*/
104-
public ProxyHints registerJdkProxy(String... proxiedInterfaces) {
105-
return registerJdkProxy(jdkProxyHint ->
106-
jdkProxyHint.proxiedInterfaces(proxiedInterfaces));
107-
}
108-
10993
/**
11094
* Register that a class proxy is required for the class defined by the
11195
* specified {@link TypeReference}.

spring-core/src/test/java/org/springframework/aot/hint/ProxyHintsTests.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
* Tests for {@link ProxyHints}.
3333
*
3434
* @author Stephane Nicoll
35-
* @author Sam Brannen
3635
*/
3736
class ProxyHintsTests {
3837

@@ -53,17 +52,10 @@ void registerJdkProxyWithConcreteClass() {
5352

5453
@Test
5554
void registerJdkProxyWithInterfaceClassNames() {
56-
this.proxyHints.registerJdkProxy(Function.class.getName(), "com.example.Advised");
57-
assertThat(this.proxyHints.jdkProxies()).singleElement()
58-
.satisfies(proxiedInterfaces(Function.class.getName(), "com.example.Advised"));
59-
}
60-
61-
@Test
62-
void registerJdkProxyWithTypeReferences() {
6355
this.proxyHints.registerJdkProxy(TypeReference.of(Function.class),
6456
TypeReference.of("com.example.Advised"));
65-
assertThat(this.proxyHints.jdkProxies()).singleElement()
66-
.satisfies(proxiedInterfaces(Function.class.getName(), "com.example.Advised"));
57+
assertThat(this.proxyHints.jdkProxies()).singleElement().satisfies(proxiedInterfaces(
58+
Function.class.getName(), "com.example.Advised"));
6759
}
6860

6961
@Test

0 commit comments

Comments
 (0)