From 46655f367e8b3172d04a40c10069019d822dbd8a Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Wed, 4 Sep 2024 17:27:01 +0200 Subject: [PATCH 1/2] Polishing --- .../web/webmvc/mvc-controller/ann-methods/requestparam.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestparam.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestparam.adoc index 5487d31368c5..fba75f9309df 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestparam.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestparam.adoc @@ -61,7 +61,7 @@ Kotlin:: By default, method parameters that use this annotation are required, but you can specify that a method parameter is optional by setting the `@RequestParam` annotation's `required` flag to -`false` or by declaring the argument with an `java.util.Optional` wrapper. +`false` or by declaring the argument with a `java.util.Optional` wrapper. Type conversion is automatically applied if the target method parameter type is not `String`. See xref:web/webmvc/mvc-controller/ann-methods/typeconversion.adoc[Type Conversion]. @@ -86,7 +86,7 @@ Java:: // ... - @PostMapping(value = "/process", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE) + @PostMapping(path = "/process", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE) public String processForm(@RequestParam MultiValueMap params) { // ... } From caaa86d6cf202fc2d07e7c8e327b19a3e0800500 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Wed, 4 Sep 2024 17:30:16 +0200 Subject: [PATCH 2/2] Make AspectJ pointcut in test more robust The previous pointcut attempted to match against a local lambda type; however, that pointcut was unreliable and failed sporadically. This commit therefore changes the pointcut so that it specifically targets the get() method of a subtype of Supplier, which seems to result in reliable pointcut matching. --- .../aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests.java index 64f670650ca8..16da2ef070d2 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests.java @@ -609,7 +609,7 @@ SupplierAdvice supplierAdvice() { @Aspect static class SupplierAdvice { - @Around("execution(public * org.springframework.aop.aspectj.autoproxy..*.*(..))") + @Around("execution(* java.util.function.Supplier+.get())") Object aroundSupplier(ProceedingJoinPoint joinPoint) throws Throwable { return "advised: " + joinPoint.proceed(); }