modified: src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java

modified:   src/main/java/de/dhbwstuttgart/bytecode/utilities/MethodAndTPH.java
This commit is contained in:
pl@gohorb.ba-horb.de 2021-03-05 10:57:42 +01:00
parent b99c022b50
commit 2ca4aad07d
2 changed files with 9 additions and 3 deletions

View File

@ -55,7 +55,10 @@ public class TPHExtractor extends AbstractASTWalker {
boolean inLocalOrParamOrReturn = false;
public final ArrayList<MethodAndTPH> ListOfMethodsAndTph = new ArrayList<>();
public Set<Pair> oldConstraints = new HashSet<>(); // Alle Constraints in einer Menge (und- & Oder-Constraints)
// Alle Constraints in einer Menge (und- & Oder-Constraints)
public Set<Pair> oldConstraints = new HashSet<>();
final ArrayList<ResultPair<TypePlaceholder, TypePlaceholder>> allPairs = new ArrayList<>();
public final ArrayList<TPHConstraint> allCons = new ArrayList<>();
private ResultSet resultSet;
@ -214,7 +217,9 @@ public class TPHExtractor extends AbstractASTWalker {
ret.addOderConstraint(setCons);} );
return ret;
};
methodAndTph = new MethodAndTPH(id, filterConstrRemainingTVar.apply(method.getConstraints()));
ConstraintSet<Pair> filteredConstraints = filterConstrRemainingTVar.apply(method.getConstraints());
methodAndTph = new MethodAndTPH(id, filteredConstraints);
oldConstraints.addAll(filteredConstraints.getAll());
inLocalOrParamOrReturn = true;
method.getReturnType().accept(this);

View File

@ -5,6 +5,7 @@ import java.util.ArrayList;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
import de.dhbwstuttgart.typeinference.constraints.Pair;
import de.dhbwstuttgart.typeinference.result.GenericInsertPair;
import de.dhbwstuttgart.typeinference.result.ResultPair;
@ -22,7 +23,7 @@ public class MethodAndTPH {
*/
public final ConstraintSet constraints;
public MethodAndTPH(String name, ConstraintSet constraints) {
public MethodAndTPH(String name, ConstraintSet<Pair> constraints) {
this.id = name;
this.constraints = constraints;
}