diff --git a/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java b/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java index 84658503..5fbea9bc 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java @@ -814,14 +814,17 @@ public class FamilyOfGeneratedGenerics { - public static List methodTypesWithoutClassTypesNEW(String tphToCompute, List cs_m, HashMap>> posOfTphs) { + public static List methodTypesWithoutClassTypesNEW(List tphsToCompute, List cs_m, HashMap>> posOfTphs) { List tempMC = new ArrayList<>(cs_m); List tempMC2 = new ArrayList<>(cs_m); - for(TPHConstraint tphCons: tempMC) { - if(tphCons.getLeft() == tphToCompute) { - String newRightTPH = tphCons.getRight(); - tempMC2.remove(tphCons); - tempMC2 = methodTypesWithoutClassTypesNEW(newRightTPH,tempMC2,posOfTphs); + List toRemove = new ArrayList<>(); + for(String tph: tphsToCompute) { + for(TPHConstraint tphCons: tempMC) { + if(tphCons.getLeft() == tph) { + toRemove.add(tphCons.getRight()); + tempMC2.remove(tphCons); + tempMC2 = methodTypesWithoutClassTypesNEW(toRemove,tempMC2,posOfTphs); + } } } return tempMC2; @@ -875,10 +878,12 @@ public class FamilyOfGeneratedGenerics { } mcWithoutCc = listToAdd; + List tphs = new ArrayList<>(); for(String tph: posOfTphs.keySet()) { for (PairTphMethod p : posOfTphs.get(tph)) { if(p.fst == PositionFinder.Position.FIELD) { - mcWithoutCc = methodTypesWithoutClassTypesNEW(tph, listToAdd, posOfTphs); + tphs.add(tph); + mcWithoutCc = methodTypesWithoutClassTypesNEW(tphs, listToAdd, posOfTphs); } } }