From 85b8704fa209d481eae795c95cd44916e4a97e6e Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Wed, 5 Nov 2014 17:48:19 +0300 Subject: [PATCH] IDEA-132269 Debugger: ISFE at StackFrameProxyImpl.isLocalVariableVisible() on attempt to show a variable --- .../ui/impl/watch/CompilingEvaluator.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/CompilingEvaluator.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/CompilingEvaluator.java index 8900db300cf1..f35dafc1d666 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/CompilingEvaluator.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/CompilingEvaluator.java @@ -84,7 +84,7 @@ public class CompilingEvaluator implements ExpressionEvaluator { ClassLoaderReference classLoader; try { - classLoader = getClassLoader(evaluationContext); + classLoader = getClassLoader(evaluationContext, process); } catch (Exception e) { throw new EvaluateException("Error creating evaluation class loader: " + e, e); @@ -129,17 +129,12 @@ public class CompilingEvaluator implements ExpressionEvaluator { } } - private static ClassLoaderReference getClassLoader(EvaluationContext context) + private static ClassLoaderReference getClassLoader(EvaluationContext context, DebugProcess process) throws EvaluateException, InvocationException, InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException { // TODO: cache - DebugProcess process = context.getDebugProcess(); ClassType loaderClass = (ClassType)process.findClass(context, "java.net.URLClassLoader", context.getClassLoader()); Method ctorMethod = loaderClass.concreteMethodByName("", "([Ljava/net/URL;Ljava/lang/ClassLoader;)V"); - ThreadReference threadReference = context.getSuspendContext().getThread().getThreadReference(); - ClassLoaderReference reference = (ClassLoaderReference)loaderClass.newInstance(threadReference, ctorMethod, - Arrays.asList(createURLArray(context), - context.getClassLoader()), - ClassType.INVOKE_SINGLE_THREADED); + ClassLoaderReference reference = (ClassLoaderReference)process.newInstance(context, loaderClass, ctorMethod, Arrays.asList(createURLArray(context), context.getClassLoader())); keep(reference, context); return reference; } @@ -243,11 +238,10 @@ public class CompilingEvaluator implements ExpressionEvaluator { keep(arrayRef, context); ClassType classType = (ClassType)process.findClass(context, "java.net.URL", context.getClassLoader()); VirtualMachineProxyImpl proxy = (VirtualMachineProxyImpl)process.getVirtualMachineProxy(); - ThreadReference threadReference = context.getSuspendContext().getThread().getThreadReference(); StringReference url = proxy.mirrorOf("file:a"); keep(url, context); - ObjectReference reference = classType.newInstance(threadReference, classType.concreteMethodByName("", "(Ljava/lang/String;)V"), - Collections.singletonList(url), ClassType.INVOKE_SINGLE_THREADED); + ObjectReference reference = process.newInstance(context, classType, classType.concreteMethodByName("", "(Ljava/lang/String;)V"), + Collections.singletonList(url)); keep(reference, context); arrayRef.setValues(Collections.singletonList(reference)); return arrayRef;