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()