modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java

Pfad des log-Files angepasst
Error-Ausgabe in der log-File Exception eingefuegt.
This commit is contained in:
Martin Plümicke 2018-12-29 10:20:19 +01:00
parent cbe77d3722
commit 531b484c53

View File

@ -45,7 +45,7 @@ public class JavaTXCompiler {
final CompilationEnvironment environment;
public final Map<File, SourceFile> sourceFiles = new HashMap<>();
Boolean log = true; //gibt an ob ein Log-File nach System.getProperty("user.dir")+"/test/logFiles/log" geschrieben werden soll?
Boolean log = true; //gibt an ob ein Log-File nach System.getProperty("user.dir")+"src/test/java/logFiles" geschrieben werden soll?
public JavaTXCompiler(File sourceFile) throws IOException, ClassNotFoundException {
this(Arrays.asList(sourceFile));
@ -278,7 +278,7 @@ public class JavaTXCompiler {
TypeUnify unify = new TypeUnify();
Set<Set<UnifyPair>> results = new HashSet<>();
try {
FileWriter logFile = new FileWriter(new File(System.getProperty("user.dir")+"/test/logFiles/"+"log"));
FileWriter logFile = new FileWriter(new File(System.getProperty("user.dir")+"/src/test/java/logFiles/"+"log"));
logFile.write("FC:\\" + finiteClosure.toString()+"\n");
for(SourceFile sf : this.sourceFiles.values()) {
logFile.write(ASTTypePrinter.print(sf));
@ -385,7 +385,9 @@ public class JavaTXCompiler {
logFile.write("PLACEHOLDERS: " + PlaceholderType.EXISTING_PLACEHOLDERS);
logFile.flush();
}
catch (IOException e) { }
catch (IOException e) {
System.err.println("kein LogFile");
}
return results.stream().map((unifyPairs ->
new ResultSet(UnifyTypeFactory.convert(unifyPairs, generateTPHMap(cons))))).collect(Collectors.toList());
}