Skip to content

Commit 4a34d82

Browse files
Fix the child process debug commands order #736 (#737)
1 parent 9730501 commit 4a34d82

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

utbot-instrumentation/src/main/kotlin/org/utbot/instrumentation/process/ChildProcessRunner.kt

+5-10
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,11 @@ private var processSeqN = 0
2121

2222
class ChildProcessRunner {
2323
private val cmds: List<String> by lazy {
24-
val debugCmd = if (Settings.runChildProcessWithDebug) {
25-
listOf(DEBUG_RUN_CMD)
26-
} else {
27-
emptyList()
28-
}
29-
30-
listOf(
31-
JdkInfoService.provide().path.resolve("bin${File.separatorChar}java").toString(),
32-
"-javaagent:$jarFile", "-ea", "-jar", "$jarFile"
33-
) + debugCmd
24+
val pathToJava = JdkInfoService.provide().path
25+
val debugCmd = listOfNotNull(DEBUG_RUN_CMD.takeIf { Settings.runChildProcessWithDebug })
26+
listOf(pathToJava.resolve("bin${File.separatorChar}java").toString()) +
27+
debugCmd +
28+
listOf("-javaagent:$jarFile", "-ea", "-jar", "$jarFile")
3429
}
3530

3631
var errorLogFile: File = NULL_FILE

0 commit comments

Comments
 (0)