From bd0517ae29c88cfbe3cf7d859989d73da5d3e865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pl=C3=BCmicke?= Date: Tue, 14 May 2019 19:54:51 +0200 Subject: [PATCH] modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java log-File in anderen Pfad modified: src/main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java substitutions gekapselt --- src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java | 2 +- .../de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java | 2 +- .../dhbwstuttgart/typeinference/unify/model/UnifyPair.java | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java b/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java index 890da346..ddf7d642 100644 --- a/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java +++ b/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java @@ -440,7 +440,7 @@ public class JavaTXCompiler { Set> results = new HashSet<>(); try { Writer logFile = //new OutputStreamWriter(new NullOutputStream()); - new FileWriter(new File(System.getProperty("user.dir")+"/src/test/java/logFiles/"+"log_"+sourceFiles.keySet().iterator().next().getName())); + new FileWriter(new File(System.getProperty("user.dir")+"/src/test/resources/logFiles/"+"log_"+sourceFiles.keySet().iterator().next().getName())); IFiniteClosure finiteClosure = UnifyTypeFactory.generateFC(allClasses,logFile); System.out.println(finiteClosure); ConstraintSet unifyCons = UnifyTypeFactory.convert(cons); diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index f13a2501..21b91e5a 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -173,7 +173,7 @@ public class TypeUnifyTask extends RecursiveTask>> { writeLog("thNo2 " + thNo); try { this.logFile = //new OutputStreamWriter(new NullOutputStream()); - new FileWriter(new File(System.getProperty("user.dir")+"/src/test/java/logFiles/"+"Thread_"+thNo)); + new FileWriter(new File(System.getProperty("user.dir")+"/src/test/resources/logFiles/"+"Thread_"+thNo)); logFile.write(""); } catch (IOException e) { diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java index 7cb1347a..222e7308 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java @@ -137,7 +137,7 @@ public class UnifyPair { undefinedPair = true; } public Set getSubstitution() { - return substitution; + return new HashSet<>(substitution); } public UnifyPair getBasePair() { @@ -149,9 +149,9 @@ public class UnifyPair { public Set getAllSubstitutions () { Set ret = new HashSet<>(); - ret.addAll(getSubstitution()); + ret.addAll(new ArrayList<>(getSubstitution())); if (basePair != null) { - ret.addAll(basePair.getAllSubstitutions()); + ret.addAll(new ArrayList<>(basePair.getAllSubstitutions())); } return ret; }