Provide class loader to ProxyFactory to create BoundOperation proxies.

Closes #2920
This commit is contained in:
Mark Paluch
2024-05-31 09:26:55 +02:00
parent f11c9f1cd5
commit d996de2b07

View File

@@ -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);
};
}