diff --git a/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java b/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java index 8c088804..162b90e8 100644 --- a/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java +++ b/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java @@ -42,10 +42,7 @@ import java.io.File; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; -<<<<<<< HEAD -======= import java.io.OutputStreamWriter; ->>>>>>> 7cb2eed36edfe2d9f3ec4ce5c0ca40702dcff7f2 import java.io.Writer; import java.util.*; import java.util.function.Function; @@ -430,13 +427,8 @@ public class JavaTXCompiler { final ConstraintSet cons = getConstraints(); Set> results = new HashSet<>(); try { -<<<<<<< HEAD - Writer logFile = new FileWriter(new File(System.getProperty("user.dir")+"/src/test/java/logFiles/"+"log_"+sourceFiles.keySet().iterator().next().getName())); -======= Writer logFile = new OutputStreamWriter(new NullOutputStream()); //new FileWriter(new File("log_"+sourceFiles.keySet().iterator().next().getName())); ->>>>>>> 7cb2eed36edfe2d9f3ec4ce5c0ca40702dcff7f2 - 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/TypeUnify.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify.java index df47e43f..2cea2184 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify.java @@ -14,7 +14,6 @@ import de.dhbwstuttgart.typeinference.unify.model.FiniteClosure; import de.dhbwstuttgart.typeinference.unify.model.UnifyPair; public class TypeUnify { -<<<<<<< HEAD /** * unify parallel ohne result modell @@ -28,17 +27,12 @@ public class TypeUnify { */ public Set> unify(Set undConstrains, List>> oderConstraints, IFiniteClosure fc, Writer logFile, Boolean log, UnifyResultModel ret) { TypeUnifyTask unifyTask = new TypeUnifyTask(undConstrains, oderConstraints, fc, true, logFile, log, 0, ret); -======= - public Set> unify(Set undConstrains, List>> oderConstraints, IFiniteClosure fc, Writer logFile, Boolean log, ConstraintSet cons) { - TypeUnifyTask unifyTask = new TypeUnifyTask(undConstrains, oderConstraints, fc, true, logFile, log, 0, new UnifyResultModel(), cons); ->>>>>>> 7cb2eed36edfe2d9f3ec4ce5c0ca40702dcff7f2 ForkJoinPool pool = new ForkJoinPool(); pool.invoke(unifyTask); Set> res = unifyTask.join(); return res; } -<<<<<<< HEAD /** * unify asynchron mit Rückgabe UnifyResultModel ohne dass alle results gesammelt sind * @param undConstrains @@ -52,16 +46,11 @@ public class TypeUnify { */ public UnifyResultModel unifyAsync(Set undConstrains, List>> oderConstraints, IFiniteClosure fc, Writer logFile, Boolean log, UnifyResultModel ret) { TypeUnifyTask unifyTask = new TypeUnifyTask(undConstrains, oderConstraints, fc, true, logFile, log, 0, ret); -======= - public UnifyResultModel unifyAsync(Set undConstrains, List>> oderConstraints, IFiniteClosure fc, Writer logFile, Boolean log, ConstraintSet cons, UnifyResultModel ret) { - TypeUnifyTask unifyTask = new TypeUnifyTask(undConstrains, oderConstraints, fc, true, logFile, log, 0, ret, cons); ->>>>>>> 7cb2eed36edfe2d9f3ec4ce5c0ca40702dcff7f2 ForkJoinPool pool = new ForkJoinPool(); pool.invoke(unifyTask); return ret; } -<<<<<<< HEAD /** * unify parallel mit Rückgabe UnifyResultModel nachdem alle results gesammelt sind * @param undConstrains @@ -75,10 +64,6 @@ public class TypeUnify { */ public UnifyResultModel unifyParallel(Set undConstrains, List>> oderConstraints, IFiniteClosure fc, Writer logFile, Boolean log, UnifyResultModel ret) { TypeUnifyTask unifyTask = new TypeUnifyTask(undConstrains, oderConstraints, fc, true, logFile, log, 0, ret); -======= - public UnifyResultModel unifyParallel(Set undConstrains, List>> oderConstraints, IFiniteClosure fc, Writer logFile, Boolean log, ConstraintSet cons, UnifyResultModel ret) { - TypeUnifyTask unifyTask = new TypeUnifyTask(undConstrains, oderConstraints, fc, true, logFile, log, 0, ret, cons); ->>>>>>> 7cb2eed36edfe2d9f3ec4ce5c0ca40702dcff7f2 ForkJoinPool pool = new ForkJoinPool(); pool.invoke(unifyTask); Set> res = unifyTask.join(); diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java index e18be625..31247aef 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java @@ -1,10 +1,7 @@ package de.dhbwstuttgart.typeinference.unify; import java.io.FileWriter; -<<<<<<< HEAD import java.io.IOException; -======= ->>>>>>> 7cb2eed36edfe2d9f3ec4ce5c0ca40702dcff7f2 import java.io.Writer; import java.util.HashSet; import java.util.List; @@ -20,13 +17,8 @@ public class TypeUnify2Task extends TypeUnifyTask { Set> setToFlatten; -<<<<<<< HEAD public TypeUnify2Task(Set> setToFlatten, Set eq, List>> oderConstraints, Set nextSetElement, IFiniteClosure fc, boolean parallel, Writer logFile, Boolean log, int rekTiefe, UnifyResultModel urm) { super(eq, oderConstraints, fc, parallel, logFile, log, rekTiefe, urm); -======= - public TypeUnify2Task(Set> setToFlatten, Set eq, List>> oderConstraints, IFiniteClosure fc, boolean parallel, Writer logFile, Boolean log, int rekTiefe, UnifyResultModel urm, ConstraintSet cons) { - super(eq, oderConstraints, fc, parallel, logFile, log, rekTiefe, urm, cons); ->>>>>>> 7cb2eed36edfe2d9f3ec4ce5c0ca40702dcff7f2 this.setToFlatten = setToFlatten; this.nextSetElement = nextSetElement; } diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index fc8e9b2d..40ce4531 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -133,11 +133,8 @@ public class TypeUnifyTask extends RecursiveTask>> { } */ -<<<<<<< HEAD + public TypeUnifyTask(Set eq, List>> oderConstraints, IFiniteClosure fc, boolean parallel, Writer logFile, Boolean log, int rekTiefe, UnifyResultModel urm) { -======= - public TypeUnifyTask(Set eq, List>> oderConstraints, IFiniteClosure fc, boolean parallel, Writer logFile, Boolean log, int rekTiefe, UnifyResultModel urm, ConstraintSet cons2) { ->>>>>>> 7cb2eed36edfe2d9f3ec4ce5c0ca40702dcff7f2 synchronized (this) { this.eq = eq; //this.oderConstraints = oderConstraints.stream().map(x -> x.stream().map(y -> new HashSet<>(y)).collect(Collectors.toSet(HashSet::new))).collect(Collectors.toList(ArrayList::new));