Bug 307 gefixt
All checks were successful
Build and Test with Maven / Build-and-test-with-Maven (push) Successful in 2m51s

Changes to be committed:
	modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   src/test/java/TestComplete.java
This commit is contained in:
pl@gohorb.ba-horb.de 2024-04-03 00:11:01 +02:00
parent 6850a8fa21
commit e37040f367
3 changed files with 19 additions and 6 deletions

View File

@ -673,7 +673,8 @@ public class TYPEStmt implements StatementVisitor {
Set<Pair> methodSignatureConstraint = generatemethodSignatureConstraint(forMethod, assumption, info, resolver);
System.out.println("methodSignatureConstraint; " + methodSignatureConstraint);
//System.out.println("methodSignatureConstraint: " + methodSignatureConstraint);
//System.out.println("methodConstraint: " + methodConstraint);
methodConstraint.setmethodSignatureConstraint(methodSignatureConstraint);
extendsMethodConstraint.setmethodSignatureConstraint(methodSignatureConstraint);

View File

@ -594,7 +594,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
/* methodconstraintsets werden zum Ergebnis hinzugefuegt
* Anfang
*/
//System.out.println("methodSignatureConstraint Return: " + methodSignatureConstraint);
//System.out.println("methodSignatureConstraint Return: " + methodSignatureConstraint + "\n");
eqPrimePrimeSet.forEach(x -> x.addAll(methodSignatureConstraint));
//Substitutionen in methodcontraintsets werdne ausgeführt
@ -885,7 +885,11 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
if (oderConstraint) {//Methodconstraints werden abgespeichert für die Bytecodegenerierung von Methodenaufrufen
methodSignatureConstraint.addAll(((Constraint<UnifyPair>)a).getmethodSignatureConstraint());
//System.out.println("ERSTELLUNG: " +methodSignatureConstraint);
writeLog("ERSTELLUNG methodSignatureConstraint: " + methodSignatureConstraint);
//System.out.println("ERSTELLUNG methodSignatureConstraint: " +noOfThread+" "+methodSignatureConstraint);
//System.out.println("a: " +a);
//System.out.println("eq: " +eq);
//System.out.println();
}
i++;
@ -1134,14 +1138,22 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
writeLog("a in " + variance + " "+ a);
writeLog("nextSetasListRest: " + nextSetasListRest.toString());
}
//Fuer parallele Berechnung der Oder-Contraints wird methodSignature kopiert
//und jeweils die methodSignature von a bzw. nSaL wieder gelöscht, wenn es keine Lösung ist.
Set<UnifyPair> methodSignatureConstraintForParallel = new HashSet<>(methodSignatureConstraint);
Set<UnifyPair> nSaL = a;
while (!nextSetasListRest.isEmpty()) {
Set<UnifyPair> nSaL = nextSetasListRest.remove(0);
methodSignatureConstraintForParallel.removeAll(((Constraint<UnifyPair>)nSaL).getmethodSignatureConstraint());
nSaL = nextSetasListRest.remove(0);
nextSetasList.remove(nSaL); //PL einkommentiert 20-02-03
methodSignatureConstraintForParallel.addAll(((Constraint<UnifyPair>)nSaL).getmethodSignatureConstraint());
Set<UnifyPair> newEq = new HashSet<>(eq);
Set<Set<UnifyPair>> newElems = new HashSet<>(elems);
List<Set<Constraint<UnifyPair>>> newOderConstraints = new ArrayList<>(oderConstraints);
newElems.add(nSaL);
TypeUnify2Task fork = new TypeUnify2Task(newElems, newEq, newOderConstraints, nSaL, fc, parallel, logFile, log, rekTiefe, urm, usedTasks, methodSignatureConstraint);
TypeUnify2Task fork = new TypeUnify2Task(newElems, newEq, newOderConstraints, nSaL, fc, parallel, logFile, log, rekTiefe, urm, usedTasks, new HashSet<>(methodSignatureConstraintForParallel));
forks.add(fork);
synchronized(usedTasks) {
if (this.myIsCancelled()) {

View File

@ -10,7 +10,7 @@ import java.util.Vector;
import targetast.TestCodegen;
import static org.junit.Assert.*;
import static targetast.TestCodegen.generateClassFiles;
import static targetast.TestCodegen.generateClassFiles;
public class TestComplete {
@Test