From 55e44d62de2193c37982f3093ce8be1271a2cf40 Mon Sep 17 00:00:00 2001 From: AluAli Date: Sat, 13 Mar 2021 14:52:38 +0100 Subject: [PATCH] modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java --- .../insertGenerics/FamilyOfGeneratedGenerics.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java b/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java index 7d6623bad..4cde842ff 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java @@ -496,8 +496,9 @@ public class FamilyOfGeneratedGenerics { r = Relation.EQUAL; } MethodConstraint mc = new MethodConstraint(ta1, ta2, r); - System.out.println(mc); - tempMC.add(mc); + if(!checkForDuplicates(mc, tempMC)) { + tempMC.add(mc); + } } return tempMC; } @@ -522,9 +523,14 @@ public class FamilyOfGeneratedGenerics { if(p.GetOperator() == PairOperator.SMALLERDOT) { r = Relation.EXTENDS; orConsWithEXTENDS.add(new TPHConstraint(((TypePlaceholder) p.TA1).getName(), ((TypePlaceholder) p.TA2).getName(), r)); + tempMC.add(new MethodConstraint(((TypePlaceholder) (resSet.resolveType(((TypePlaceholder) p.TA1)).resolvedType)).getName(), ((TypePlaceholder) (resSet.resolveType(((TypePlaceholder) p.TA2)).resolvedType)).getName(), r)); } else if(p.GetOperator() == PairOperator.EQUALSDOT) { r = Relation.EQUAL; orConsWithEQUAL.add(new TPHConstraint(((TypePlaceholder) p.TA1).getName(), ((TypePlaceholder) p.TA2).getName(), r)); + MethodConstraint mc = new MethodConstraint(((TypePlaceholder) (resSet.resolveType(((TypePlaceholder) p.TA1)).resolvedType)).getName(), ((TypePlaceholder) (resSet.resolveType(((TypePlaceholder) p.TA2)).resolvedType)).getName(), r); + if(!checkForDuplicates(mc, tempMC)) { + tempMC.add(mc); + } } } } @@ -602,8 +608,9 @@ public class FamilyOfGeneratedGenerics { r = Relation.EQUAL; } MethodConstraint mc = new MethodConstraint(ta1, ta2, r); - System.out.println(mc); - tempMC.add(mc); + if(!checkForDuplicates(mc, tempMC)) { + tempMC.add(mc); + } } return tempMC;