diff --git a/spring-core/src/main/java/org/springframework/aot/hint/ClassProxyHint.java b/spring-core/src/main/java/org/springframework/aot/hint/ClassProxyHint.java index 043e919229d..88b6678e467 100644 --- a/spring-core/src/main/java/org/springframework/aot/hint/ClassProxyHint.java +++ b/spring-core/src/main/java/org/springframework/aot/hint/ClassProxyHint.java @@ -48,11 +48,11 @@ public final class ClassProxyHint implements ConditionalHint { /** * Initialize a builder with the target class to use. - * @param targetClass the target class of the proxy + * @param typeReference the type reference for the target class of the proxy * @return a builder for the hint */ - public static Builder of(TypeReference targetClass) { - return new Builder(targetClass); + public static Builder of(TypeReference typeReference) { + return new Builder(typeReference); } /** diff --git a/spring-core/src/main/java/org/springframework/aot/hint/JdkProxyHint.java b/spring-core/src/main/java/org/springframework/aot/hint/JdkProxyHint.java index c9f21c481ca..c8c7af2ccda 100644 --- a/spring-core/src/main/java/org/springframework/aot/hint/JdkProxyHint.java +++ b/spring-core/src/main/java/org/springframework/aot/hint/JdkProxyHint.java @@ -25,8 +25,7 @@ import java.util.Objects; import org.springframework.lang.Nullable; /** - * A hint that describes the need of a JDK {@link Proxy}, that is an - * interfaces-based proxy. + * A hint that describes the need for a JDK interface-based {@link Proxy}. * * @author Stephane Nicoll * @author Brian Clozel @@ -145,7 +144,7 @@ public final class JdkProxyHint implements ConditionalHint { /** * Create a {@link JdkProxyHint} based on the state of this builder. - * @return a jdk proxy hint + * @return a JDK proxy hint */ JdkProxyHint build() { return new JdkProxyHint(this); diff --git a/spring-core/src/main/java/org/springframework/aot/hint/ProxyHints.java b/spring-core/src/main/java/org/springframework/aot/hint/ProxyHints.java index d0ba6cafa48..e02a3f201cd 100644 --- a/spring-core/src/main/java/org/springframework/aot/hint/ProxyHints.java +++ b/spring-core/src/main/java/org/springframework/aot/hint/ProxyHints.java @@ -24,7 +24,7 @@ import java.util.stream.Stream; import org.springframework.aot.hint.ClassProxyHint.Builder; /** - * Gather the need of using proxies at runtime. + * Gather the need for using proxies at runtime. * * @author Stephane Nicoll * @since 6.0 @@ -37,7 +37,7 @@ public class ProxyHints { /** - * Return the interfaces-based proxies that are required. + * Return the interface-based proxies that are required. * @return a stream of {@link JdkProxyHint} */ public Stream jdkProxies() { @@ -54,7 +54,7 @@ public class ProxyHints { /** * Register a {@link JdkProxyHint}. - * @param jdkProxyHint the supplier to the hint + * @param jdkProxyHint the consumer of the hint builder * @return {@code this}, to facilitate method chaining */ public ProxyHints registerJdkProxy(Consumer jdkProxyHint) { @@ -66,8 +66,9 @@ public class ProxyHints { /** * Register that a JDK proxy implementing the interfaces defined by the - * specified {@link TypeReference type references} is required. - * @param proxiedInterfaces the interfaces the proxy should implement + * specified {@linkplain TypeReference type references} is required. + * @param proxiedInterfaces the type references for the interfaces the proxy + * should implement * @return {@code this}, to facilitate method chaining */ public ProxyHints registerJdkProxy(TypeReference... proxiedInterfaces) { @@ -89,12 +90,12 @@ public class ProxyHints { /** * Register that a class proxy is required for the class defined by the * specified {@link TypeReference}. - * @param targetClass the target class of the proxy + * @param typeReference the type reference for the target class of the proxy * @param classProxyHint a builder to further customize the hint for that proxy * @return {@code this}, to facilitate method chaining */ - public ProxyHints registerClassProxy(TypeReference targetClass, Consumer classProxyHint) { - return addClassProxyHint(ClassProxyHint.of(targetClass), classProxyHint); + public ProxyHints registerClassProxy(TypeReference typeReference, Consumer classProxyHint) { + return addClassProxyHint(ClassProxyHint.of(typeReference), classProxyHint); } /** diff --git a/spring-core/src/test/java/org/springframework/aot/hint/ProxyHintsTests.java b/spring-core/src/test/java/org/springframework/aot/hint/ProxyHintsTests.java index 016a432cace..ff749c91502 100644 --- a/spring-core/src/test/java/org/springframework/aot/hint/ProxyHintsTests.java +++ b/spring-core/src/test/java/org/springframework/aot/hint/ProxyHintsTests.java @@ -59,13 +59,13 @@ class ProxyHintsTests { } @Test - void registerJdkProxyWithSupplier() { + void registerJdkProxyWithConsumer() { this.proxyHints.registerJdkProxy(springProxy(TypeReference.of("com.example.Test"))); assertThat(this.proxyHints.jdkProxies()).singleElement().satisfies(proxiedInterfaces( + "com.example.Test", "org.springframework.aop.SpringProxy", "org.springframework.aop.framework.Advised", - "org.springframework.core.DecoratingProxy", - "com.example.Test")); + "org.springframework.core.DecoratingProxy")); } @Test @@ -102,10 +102,11 @@ class ProxyHintsTests { } private static Consumer springProxy(TypeReference proxiedInterface) { - return builder -> builder.proxiedInterfaces(Stream.of("org.springframework.aop.SpringProxy", + return builder -> builder + .proxiedInterfaces(proxiedInterface) + .proxiedInterfaces(Stream.of("org.springframework.aop.SpringProxy", "org.springframework.aop.framework.Advised", "org.springframework.core.DecoratingProxy") - .map(TypeReference::of).toArray(TypeReference[]::new)) - .proxiedInterfaces(proxiedInterface); + .map(TypeReference::of).toArray(TypeReference[]::new)); } private Consumer proxiedInterfaces(String... proxiedInterfaces) {