diff --git a/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java b/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java index 71b4886b4..50170cdf5 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java @@ -197,21 +197,22 @@ public class FamilyOfGeneratedGenerics { * {R' <. S | (R <. R') \in cs_m, (S <. S') \in cs_cl and (R',S) is in the transitive closure of cs} */ - public static List secondTransitiveSubtypeForMethodTypes(List allConstraints, List cs_m, HashMap> posOfTphs) { + public static List secondTransitiveSubtypeForMethodTypes(List allConstraints, List cs_cl, List cs_m, HashMap> posOfTphs) { //TODO: List tempCC= new ArrayList<>(); List tcOfCs = buildTransitiveClosure(allConstraints); - for(MethodConstraint mC1 : cs_m) { - for(MethodConstraint mC2 : cs_m) { - String rightSide = mC1.getRight(); - String leftSide = mC2.getLeft(); + for(ClassConstraint cC : cs_cl) { + for(MethodConstraint mC : cs_m) { + String rightSide = mC.getRight(); + String leftSide = cC.getLeft(); for(TPHConstraint tphC : tcOfCs) { - + if(tphC.getLeft().equals(leftSide)&&tphC.getRight().equals(rightSide)) { + tempCC.add((MethodConstraint) tphC); + } } } } - return null; - return null; + return tempCC; } /**