From 74b6f70c80dc5c6119c2aa325959d77670541f98 Mon Sep 17 00:00:00 2001 From: Natalia Ukhorskaya Date: Mon, 30 Nov 2015 18:19:16 +0300 Subject: [PATCH] JDIEval: do not disable collection when invoke method using reflection --- eval4j/src/org/jetbrains/eval4j/jdi/jdiEval.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eval4j/src/org/jetbrains/eval4j/jdi/jdiEval.kt b/eval4j/src/org/jetbrains/eval4j/jdi/jdiEval.kt index 2d7c66b1fac..06be613793b 100644 --- a/eval4j/src/org/jetbrains/eval4j/jdi/jdiEval.kt +++ b/eval4j/src/org/jetbrains/eval4j/jdi/jdiEval.kt @@ -225,12 +225,12 @@ public class JDIEval( if (_class !is ClassType) throwBrokenCodeException(NoSuchMethodError("Static method is a non-class type: $method")) val args = mapArguments(arguments, method.safeArgumentTypes()) - args.disableCollection() if (shouldInvokeMethodWithReflection(method, args)) { return invokeMethodWithReflection(_class.asType(), NULL_VALUE, args, methodDesc) } + args.disableCollection() val result = mayThrow { _class.invokeMethod(thread, method, args, invokePolicy) } args.enableCollection() return result.asValue() @@ -296,12 +296,12 @@ public class JDIEval( fun doInvokeMethod(obj: ObjectReference, method: Method, policy: Int): Value { val args = mapArguments(arguments, method.safeArgumentTypes()) - args.disableCollection() if (shouldInvokeMethodWithReflection(method, args)) { return invokeMethodWithReflection(instance.asmType, instance, args, methodDesc) } + args.disableCollection() val result = mayThrow { obj.invokeMethod(thread, method, args, policy) } args.enableCollection() return result.asValue()