diff --git a/src/main/java/de/dhbwstuttgart/target/generate/ASTToTargetAST.java b/src/main/java/de/dhbwstuttgart/target/generate/ASTToTargetAST.java index b28bfb41..3ebd5430 100644 --- a/src/main/java/de/dhbwstuttgart/target/generate/ASTToTargetAST.java +++ b/src/main/java/de/dhbwstuttgart/target/generate/ASTToTargetAST.java @@ -116,6 +116,8 @@ public class ASTToTargetAST { } return false; }); + } else if (input.stream().anyMatch(p -> p.getLeft().equals(pair.getLeft()))) { + return; } input.add(pair); @@ -605,14 +607,14 @@ public class ASTToTargetAST { if (left.equals(tph)) { var pair = new PairTPHsmallerTPH(tph, right); if (!generics.contains(pair)) { - generics.add(pair); + addToPairs(generics, pair); findAllBounds(right, generics, equality); found = true; } } } if (!found) - generics.add(new PairTPHequalRefTypeOrWildcardType(tph, OBJECT)); + addToPairs(generics, new PairTPHequalRefTypeOrWildcardType(tph, OBJECT)); } else if (type instanceof RefType refType) { refType.getParaList().forEach(t -> findAllBounds(t, generics, equality)); } @@ -663,7 +665,6 @@ public class ASTToTargetAST { } } } - System.out.println(input); } void findTphs(RefTypeOrTPHOrWildcardOrGeneric type, Set tphs, Map equality) {