From 02cbee560d32fe63faac8e3477a4aa63ca7c46f1 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 26 Jun 2023 19:28:38 +0200 Subject: [PATCH] Polishing (cherry picked from commit 6526e79eea450e49558035fc22b1c8d11ef2c285) --- .../messaging/handler/invocation/ResolvableMethod.java | 6 ++++-- .../web/testfixture/method/ResolvableMethod.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/spring-messaging/src/test/java/org/springframework/messaging/handler/invocation/ResolvableMethod.java b/spring-messaging/src/test/java/org/springframework/messaging/handler/invocation/ResolvableMethod.java index 5afebe3340fb..b38e1ca4f47a 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/handler/invocation/ResolvableMethod.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/handler/invocation/ResolvableMethod.java @@ -613,11 +613,12 @@ private List applyFilters() { private static class MethodInvocationInterceptor implements MethodInterceptor, InvocationHandler { + @Nullable private Method invokedMethod; @Override @Nullable - public Object intercept(Object object, Method method, Object[] args, MethodProxy proxy) { + public Object intercept(Object object, Method method, @Nullable Object[] args, @Nullable MethodProxy proxy) { if (ReflectionUtils.isObjectMethod(method)) { return ReflectionUtils.invokeMethod(method, object, args); } @@ -629,10 +630,11 @@ public Object intercept(Object object, Method method, Object[] args, MethodProxy @Override @Nullable - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + public Object invoke(Object proxy, Method method, @Nullable Object[] args) { return intercept(proxy, method, args, null); } + @Nullable Method getInvokedMethod() { return this.invokedMethod; } diff --git a/spring-web/src/testFixtures/java/org/springframework/web/testfixture/method/ResolvableMethod.java b/spring-web/src/testFixtures/java/org/springframework/web/testfixture/method/ResolvableMethod.java index 2ad3eb4e2058..52a48d98b9c4 100644 --- a/spring-web/src/testFixtures/java/org/springframework/web/testfixture/method/ResolvableMethod.java +++ b/spring-web/src/testFixtures/java/org/springframework/web/testfixture/method/ResolvableMethod.java @@ -617,11 +617,12 @@ private List applyFilters() { private static class MethodInvocationInterceptor implements MethodInterceptor, InvocationHandler { + @Nullable private Method invokedMethod; @Override @Nullable - public Object intercept(Object object, Method method, Object[] args, MethodProxy proxy) { + public Object intercept(Object object, Method method, @Nullable Object[] args, @Nullable MethodProxy proxy) { if (ReflectionUtils.isObjectMethod(method)) { return ReflectionUtils.invokeMethod(method, object, args); } @@ -633,10 +634,11 @@ public Object intercept(Object object, Method method, Object[] args, MethodProxy @Override @Nullable - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + public Object invoke(Object proxy, Method method, @Nullable Object[] args) { return intercept(proxy, method, args, null); } + @Nullable Method getInvokedMethod() { return this.invokedMethod; }