modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
This commit is contained in:
parent
f69554c6a1
commit
bb5692da8e
@ -578,9 +578,9 @@ public class FamilyOfGeneratedGenerics {
|
|||||||
while (itRunSet.hasNext()) {
|
while (itRunSet.hasNext()) {
|
||||||
Pair pairRunSet = itRunSet.next();
|
Pair pairRunSet = itRunSet.next();
|
||||||
// if(cons.getRight() == cons2.getLeft()) {
|
// if(cons.getRight() == cons2.getLeft()) {
|
||||||
if(pairIterSet.TA2 == pairRunSet.TA1) {
|
if(pairIterSet.TA2 == pairRunSet.TA1 && pairIterSet.OperatorSmallerDot() && pairRunSet.OperatorSmallerDot()) {
|
||||||
// TPHConstraint consToAdd = new TPHConstraint(cons.getLeft(), cons2.getRight(), Relation.EXTENDS);
|
// TPHConstraint consToAdd = new TPHConstraint(cons.getLeft(), cons2.getRight(), Relation.EXTENDS);
|
||||||
Pair p = new Pair(pairIterSet.TA1, pairRunSet.TA2);
|
Pair p = new Pair(pairIterSet.TA1, pairRunSet.TA2, PairOperator.SMALLERDOT);
|
||||||
// if (!checkForDuplicates(consToAdd,tcList)) {
|
// if (!checkForDuplicates(consToAdd,tcList)) {
|
||||||
if(!tcSet.contains(p)) {
|
if(!tcSet.contains(p)) {
|
||||||
// tcList.add(consToAdd);
|
// tcList.add(consToAdd);
|
||||||
@ -593,9 +593,29 @@ public class FamilyOfGeneratedGenerics {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
System.out.println("tcSet: " + tcSet);
|
||||||
return tcSet;
|
return tcSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean checkForDuplicatesForSets(Pair pair, Set set) {
|
||||||
|
Set<Pair> tempSet = set;
|
||||||
|
boolean hasSame = false;
|
||||||
|
// for (TPHConstraint tphC: tempList) {
|
||||||
|
Iterator<Pair> it = set.iterator();
|
||||||
|
while (it.hasNext()) {
|
||||||
|
Pair p = it.next();
|
||||||
|
// hasSame = constraint.getLeft() == tphC.getLeft() &&
|
||||||
|
// constraint.getRight() == tphC.getRight() &&
|
||||||
|
// constraint.getRel() == tphC.getRel(); //constraint already in ArrayList if true
|
||||||
|
hasSame = pair.TA1 == pair.TA1 &&
|
||||||
|
pair.TA2 == p.TA2 &&
|
||||||
|
pair.OperatorSmallerDot() && p.OperatorSmallerDot(); //constraint already in Set if true
|
||||||
|
if (hasSame)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static HashMap<String, List<MethodConstraint>> getMethodConstraintsWithPositionNew(List<TPHConstraint> cs, List<ClassConstraint> cs_cl, HashMap<String, List<PairTphMethod<PositionFinder.Position, String>>> posOfTphs, List<MethodAndTPH> listOfMethodsAndTph, ResultSet resSet, Set<Pair> oldCons) {
|
public static HashMap<String, List<MethodConstraint>> getMethodConstraintsWithPositionNew(List<TPHConstraint> cs, List<ClassConstraint> cs_cl, HashMap<String, List<PairTphMethod<PositionFinder.Position, String>>> posOfTphs, List<MethodAndTPH> listOfMethodsAndTph, ResultSet resSet, Set<Pair> oldCons) {
|
||||||
HashMap<String, List<MethodConstraint>> tempMethodConstraintsWithPosition = new HashMap<>();
|
HashMap<String, List<MethodConstraint>> tempMethodConstraintsWithPosition = new HashMap<>();
|
||||||
List<MethodConstraint> newMCList = new ArrayList<>();
|
List<MethodConstraint> newMCList = new ArrayList<>();
|
||||||
|
Loading…
Reference in New Issue
Block a user