diff --git a/eval4j/src/org/jetbrains/eval4j/jdi/jdiEval.kt b/eval4j/src/org/jetbrains/eval4j/jdi/jdiEval.kt index 7b708ec3f73..af6d60070b2 100644 --- a/eval4j/src/org/jetbrains/eval4j/jdi/jdiEval.kt +++ b/eval4j/src/org/jetbrains/eval4j/jdi/jdiEval.kt @@ -28,7 +28,8 @@ val BOOTSTRAP_CLASS_DESCRIPTORS = setOf("Ljava/lang/String;", "Ljava/lang/ClassL class JDIEval( private val vm: jdi.VirtualMachine, private val classLoader: jdi.ClassLoaderReference, - private val thread: jdi.ThreadReference + private val thread: jdi.ThreadReference, + private val invokePolicy: Int ) : Eval { private val primitiveTypes = mapOf( @@ -192,7 +193,7 @@ class JDIEval( if (_class !is jdi.ClassType) throwEvalException(NoSuchMethodError("Static method is a non-class type: $method")) val args = mapArguments(arguments, method.safeArgumentTypes()) - val result = mayThrow { _class.invokeMethod(thread, method, args, 0) } + val result = mayThrow { _class.invokeMethod(thread, method, args, invokePolicy) } return result.asValue() } @@ -218,7 +219,7 @@ class JDIEval( val ctor = findMethod(methodDesc) val _class = (instance as NewObjectValue).asmType.asReferenceType() as jdi.ClassType val args = mapArguments(arguments, ctor.safeArgumentTypes()) - val result = mayThrow { _class.newInstance(thread, ctor, args, 0) } + val result = mayThrow { _class.newInstance(thread, ctor, args, invokePolicy) } instance.value = result return result.asValue() } @@ -231,7 +232,7 @@ class JDIEval( val obj = instance.jdiObj.checkNull() val method = findMethod(methodDesc, instance.jdiObj!!.referenceType() ?: methodDesc.ownerType.asReferenceType()) val args = mapArguments(arguments, method.safeArgumentTypes()) - val result = mayThrow { obj.invokeMethod(thread, method, args, 0) } + val result = mayThrow { obj.invokeMethod(thread, method, args, invokePolicy) } return result.asValue() } diff --git a/eval4j/test/org/jetbrains/eval4j/jdi/test/jdiTest.kt b/eval4j/test/org/jetbrains/eval4j/jdi/test/jdiTest.kt index 5bf86b7804d..e1bf8a7dcbb 100644 --- a/eval4j/test/org/jetbrains/eval4j/jdi/test/jdiTest.kt +++ b/eval4j/test/org/jetbrains/eval4j/jdi/test/jdiTest.kt @@ -102,7 +102,7 @@ fun suite(): TestSuite { override fun runTest() { val eval = JDIEval( - vm, classLoader!!, thread!! + vm, classLoader!!, thread!!, 0 ) val value = interpreterLoop( methodNode,