From af223a4d8ad4b3f8f9043660f9ecd2a9138190d3 Mon Sep 17 00:00:00 2001 From: AluAli Date: Fri, 26 Mar 2021 20:53:24 +0100 Subject: [PATCH] modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java --- .../FamilyOfGeneratedGenerics.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) 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); } } }