Merge branch '14-introduce-new-decompiler'

This commit is contained in:
Bartłomiej Pluta
2019-04-11 17:20:23 +02:00

View File

@@ -24,30 +24,32 @@ public class ProcessExecutor {
} }
private void printCommandLine(String[] command, boolean debug) { private void printCommandLine(String[] command, boolean debug) {
if(debug) { if (debug) {
System.out.println(String.join(" ", command)); System.out.println(String.join(" ", command));
} }
} }
private void printStdOutAndStdErrFromProcess(boolean debug, Process process) { private void printStdOutAndStdErrFromProcess(boolean debug, Process process) {
if(debug) { BufferedReader stdout = new BufferedReader(new InputStreamReader(process.getInputStream()));
BufferedReader stdout = new BufferedReader(new InputStreamReader(process.getInputStream())); BufferedReader stderr = new BufferedReader(new InputStreamReader(process.getErrorStream()));
BufferedReader stderr = new BufferedReader(new InputStreamReader(process.getErrorStream())); String line;
String line; try {
try { while ((line = stdout.readLine()) != null) {
while ((line = stdout.readLine()) != null) { if (debug) {
System.out.println(line); System.out.println(line);
} }
}
while ((line = stderr.readLine()) != null) { while ((line = stderr.readLine()) != null) {
if (debug) {
System.err.println(line); System.err.println(line);
} }
stdout.close();
stderr.close();
} catch (IOException e) {
throw new EsaException(e);
} }
stdout.close();
stderr.close();
} catch (IOException e) {
throw new EsaException(e);
} }
} }