From cfacc6235ce6c8e98da77aa487594ddc1c4e2d90 Mon Sep 17 00:00:00 2001 From: AluAli Date: Fri, 22 Jan 2021 15:13:03 +0100 Subject: [PATCH] modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java --- .../FamilyOfGeneratedGenerics.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java b/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java index f5c06a0c2..3f11424bc 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java @@ -35,25 +35,19 @@ public class FamilyOfGeneratedGenerics { cs_cl.add(cons); } } - boolean equalsConstraintsList = false; - List tempList = new ArrayList<>(); + boolean addedToConstraintsList = false; do { + addedToConstraintsList = false; List classConstraints2 = new ArrayList<>(); classConstraints2 = transitiveSubtypeForClassTypes(cs, cs_cl); // in Klammer classConstraints1 oder constraintsSet? beides eher - if (classConstraints2 == tempList) { - equalsConstraintsList = true; - } + for (ClassConstraint cons: classConstraints2) { if (!checkForDuplicates(cons, cs_cl)) { cs_cl.add(cons); + addedToConstraintsList = true; } } - tempList = new ArrayList<>(classConstraints2); - for (ClassConstraint cc : tempList) { - classConstraints2.remove(cc); - System.out.println(classConstraints2); - } - }while(!equalsConstraintsList); + }while(addedToConstraintsList); List classConstraints3 = hasNoSupertypeForClassTypes(cs, cs_cl, posOfTphs); for (ClassConstraint cons: classConstraints3) {