From 30e4bb7bb9325d8ede771926a6dbd9e63eb82021 Mon Sep 17 00:00:00 2001 From: Marcus Mews Date: Mon, 20 Oct 2025 20:47:30 +0000 Subject: [PATCH] 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 --- .../src/com/jetbrains/python/vp/ViewPresenterUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/python-psi-impl/src/com/jetbrains/python/vp/ViewPresenterUtils.java b/python/python-psi-impl/src/com/jetbrains/python/vp/ViewPresenterUtils.java index 500764b308a3..080e624911ef 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/vp/ViewPresenterUtils.java +++ b/python/python-psi-impl/src/com/jetbrains/python/vp/ViewPresenterUtils.java @@ -63,6 +63,7 @@ public final class ViewPresenterUtils { private static C createProxy(Class 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); } }