PY-84545 PY-84716 Fix class loader problem

- use given clazz's class loader to avoid "is not visible from class loader" check in java.lang.Proxy.ensureVisible()

GitOrigin-RevId: 5d275b1353383691fe907caa039a15706e9b7a18
This commit is contained in:
Marcus Mews
2025-10-20 20:47:30 +00:00
committed by intellij-monorepo-bot
parent e366f39630
commit 30e4bb7bb9
@@ -63,6 +63,7 @@ public final class ViewPresenterUtils {
private static <C> C createProxy(Class<C> clazz, InvocationHandler handler) {
assert clazz != null;
assert handler != null;
return ReflectionUtil.proxy(ViewPresenterUtils.class.getClassLoader(), clazz, handler);
ClassLoader classLoader = clazz.getClassLoader(); // clazz's class loader allows [java.lang.reflect.Proxy#ensureVisible]
return ReflectionUtil.proxy(classLoader, clazz, handler);
}
}