Skip to content

Commit

Permalink
do not switch System.out back
Browse files Browse the repository at this point in the history
  • Loading branch information
phiSgr committed Mar 18, 2023
1 parent 3bc8c4b commit 17af9a0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions executors/src/main/kotlin/JavaRunnerExecutor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,14 @@ class JavaRunnerExecutor {
}
System.out.flush()
System.err.flush()
System.setOut(defaultOutputStream)
outputObj.text = outputStream.toString()
.replace("</errStream><errStream>".toRegex(), "")
.replace("</outStream><outStream>".toRegex(), "")
print(mapper.writeValueAsString(outputObj))
defaultOutputStream.print(mapper.writeValueAsString(outputObj))
}
catch (e: Throwable) {
System.setOut(defaultOutputStream)
System.out.println(mapper.writeValueAsString(RunOutput(exception = e)))
println(mapper.writeValueAsString(RunOutput(exception = e)))
}
}
}
Expand Down

0 comments on commit 17af9a0

Please sign in to comment.