From d996de2b0798284b92e8bce5efe768592dc249c9 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 31 May 2024 09:26:55 +0200 Subject: [PATCH] Provide class loader to ProxyFactory to create BoundOperation proxies. Closes #2920 --- .../data/redis/core/BoundOperationsProxyFactory.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/springframework/data/redis/core/BoundOperationsProxyFactory.java b/src/main/java/org/springframework/data/redis/core/BoundOperationsProxyFactory.java index a65b1e200..423cd3b4f 100644 --- a/src/main/java/org/springframework/data/redis/core/BoundOperationsProxyFactory.java +++ b/src/main/java/org/springframework/data/redis/core/BoundOperationsProxyFactory.java @@ -70,7 +70,7 @@ class BoundOperationsProxyFactory { proxyFactory.addAdvice( new BoundOperationsMethodInterceptor(key, operations, boundOperationsInterface, operationsTarget, delegate)); - return (T) proxyFactory.getProxy(); + return (T) proxyFactory.getProxy(getClass().getClassLoader()); } Method lookupRequiredMethod(Method method, Class targetClass, boolean considerKeyArgument) { @@ -144,9 +144,9 @@ class BoundOperationsProxyFactory { yield null; } case "getOperations" -> delegate.getOps(); - default -> method.getDeclaringClass() == boundOperationsInterface - ? doInvoke(invocation, method, operationsTarget, true) - : doInvoke(invocation, method, delegate, false); + default -> + method.getDeclaringClass() == boundOperationsInterface ? doInvoke(invocation, method, operationsTarget, true) + : doInvoke(invocation, method, delegate, false); }; }