forked from JavaTX/JavaCompilerCore
added non-threaded close() method for logging
This commit is contained in:
parent
c14dd6e97c
commit
c292ff2d9e
@ -65,6 +65,10 @@ public class TypeUnify2Task extends TypeUnifyTask {
|
||||
}
|
||||
|
||||
public void closeLogFile() {
|
||||
logFile.close();
|
||||
if(parallel){
|
||||
logFile.close();
|
||||
}else{
|
||||
logFile.closeNonThreaded();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -186,7 +186,6 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
||||
}else{
|
||||
this.logFile = new WriterActiveObject(new OutputStreamWriter(new NullOutputStream()), pool);
|
||||
}
|
||||
logFile.write("");
|
||||
}
|
||||
catch (IOException e) {
|
||||
System.err.println("log-File nicht vorhanden");
|
||||
@ -268,7 +267,11 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
||||
Set<Set<UnifyPair>> res = unify(neweq, remainingOderconstraints, fc, parallel, rekTiefeField, new HashSet<>());
|
||||
noOfThread--;
|
||||
|
||||
logFile.close();
|
||||
if(parallel){
|
||||
logFile.close();
|
||||
}else{
|
||||
logFile.closeNonThreaded();
|
||||
}
|
||||
|
||||
if (isUndefinedPairSetSet(res)) {
|
||||
//fuer debug-Zwecke
|
||||
|
@ -42,4 +42,12 @@ public class WriterActiveObject {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void closeNonThreaded(){
|
||||
try {
|
||||
writer.close();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user