diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index a21cbe29a..902eb3d00 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -2592,11 +2592,19 @@ public class TypeUnifyTask extends RecursiveTask>> { void writeLog(String str) { if (log && finalresult) { - logFile.write("Thread no.:" + thNo + "\n" - + "noOfThread:" + noOfThread + "\n" - + "parallel:" + parallel + "\n" - + str+"\n\n" - ); + if(parallel){ + logFile.write("Thread no.:" + thNo + "\n" + + "noOfThread:" + noOfThread + "\n" + + "parallel:" + parallel + "\n" + + str+"\n\n" + ); + }else{ + logFile.writeNonThreaded("Thread no.:" + thNo + "\n" + + "noOfThread:" + noOfThread + "\n" + + "parallel:" + parallel + "\n" + + str+"\n\n" + ); + } } } diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/WriterActiveObject.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/WriterActiveObject.java index c8b6a7c5a..1b7ed7063 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/WriterActiveObject.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/WriterActiveObject.java @@ -29,8 +29,17 @@ public class WriterActiveObject { writer.write(message); writer.flush(); } catch (IOException e) { - System.out.println(e.getMessage()); + throw new RuntimeException(e); } }); } + + public void writeNonThreaded(String message){ + try { + writer.write(message); + writer.flush(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } }