From ab37ec4d31db5bb80a0ed85c26e24a998e71e667 Mon Sep 17 00:00:00 2001 From: SeeBasTStick <sebastian.stock@hhu.de> Date: Tue, 1 Sep 2020 19:10:39 +0200 Subject: [PATCH] cleaning up unused code --- .../probCli/ProBCommandLineAccess.kt | 51 +------------------ 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/src/main/kotlin/b/language/server/proBMangement/probCli/ProBCommandLineAccess.kt b/src/main/kotlin/b/language/server/proBMangement/probCli/ProBCommandLineAccess.kt index 4e30a66..3f18cae 100644 --- a/src/main/kotlin/b/language/server/proBMangement/probCli/ProBCommandLineAccess.kt +++ b/src/main/kotlin/b/language/server/proBMangement/probCli/ProBCommandLineAccess.kt @@ -70,6 +70,7 @@ class ProBCommandLineAccess(val communicator : CommunicatorInterface) : ProBInte "PERFORMANCE_INFO" + //voiding stdout and stderr val outputSink = if(System.getProperty("os.name").toLowerCase().contains("win")){ File("NUL") }else{ @@ -156,16 +157,6 @@ class ProBCommandLineAccess(val communicator : CommunicatorInterface) : ProBInte val process: Process = command.start() - //just void error and output - communicator.sendDebugMessage("clearing input stream", MessageType.Info) - - readAndVoid(process.inputStream) - communicator.sendDebugMessage("clearing error stream", MessageType.Info) - - readAndVoid(process.errorStream) - - - communicator.sendDebugMessage("waiting for process to return", MessageType.Info) // process.waitFor() //we must wait here to ensure correct behavior when reading an error @@ -174,46 +165,6 @@ class ProBCommandLineAccess(val communicator : CommunicatorInterface) : ProBInte } - private fun readAndVoid(stream: InputStream) { - stream.readAllBytes() - } - - private fun readFromStream(stream: InputStream) : String{ - return "" - - // stream.readAllBytes() - -/* val reader = BufferedReader(InputStreamReader(stream)) - - val builder = StringBuilder() - var line: String? - - - - var currentLine = reader.readLine() - while (currentLine != null){ - communicator.sendDebugMessage("current line $currentLine", MessageType.Info) - communicator.sendDebugMessage("reading next line ", MessageType.Info) - currentLine = reader.readLine() - communicator.sendDebugMessage("checking line", MessageType.Info) - } - -*/ - /* - while (reader.readLine().also { line = it } != null) { - communicator.sendDebugMessage("read line", MessageType.Info) - - builder.append(line) - builder.append(System.getProperty("line.separator")) - communicator.sendDebugMessage("Line Contains, $line and ${line!!.length} symboles", MessageType.Info) - } - communicator.sendDebugMessage("returning", MessageType.Info) - - - */ - // return builder.toString() - } - /** * Reads the errors and transforms them to java objects -- GitLab