diff --git a/src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java b/src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java index b908afa6..2923da74 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java @@ -55,6 +55,7 @@ public class TPHExtractor extends AbstractASTWalker { boolean inLocalOrParamOrReturn = false; public final ArrayList ListOfMethodsAndTph = new ArrayList<>(); + public Set oldConstraints = new HashSet<>(); // Alle Constraints in einer Menge (und- & Oder-Constraints) final ArrayList> allPairs = new ArrayList<>(); public final ArrayList allCons = new ArrayList<>(); private ResultSet resultSet; diff --git a/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java b/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java index 544d43be..6b3cd99b 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java @@ -136,7 +136,7 @@ public class FamilyOfGeneratedGenerics { listOfThisMethod = getMethodConstraints(cs,cs_cl,posOfTPHsForThisMethod,listOfMethodsAndTph); tempMethodConstraintsWithPosition.put(currentMethod, listOfThisMethod); - List newMCList = firstLineMethodDefinition(cs, posOfTphs, resSet); + List newMCList = firstLineMethodDefinition(cs, posOfTphs, method, resSet); } } @@ -477,29 +477,36 @@ public class FamilyOfGeneratedGenerics { } */ - public static List firstLineMethodDefinition(List allConstraints, HashMap>> posOfTphs, ResultSet resSet) { + public static List firstLineMethodDefinition(List allConstraints, HashMap>> posOfTphs, MethodAndTPH methodAndTPH, ResultSet resSet) { List tempMC= new ArrayList<>(); -// MethodAndTPH methAndTphs = methodAndTPH; -// Set undCons = methAndTphs.constraints.getUndConstraints(); -// Iterator it = undCons.iterator(); + MethodAndTPH methAndTphs = methodAndTPH; + Set undCons = methAndTphs.constraints.getUndConstraints(); + List> orCons = methAndTphs.constraints.getOderConstraints(); + Iterator it = undCons.iterator(); + while(it.hasNext()) { + Pair p = it.next(); + String ta1 = ((TypePlaceholder) p.TA1).getName(); + String ta2 = ((TypePlaceholder) p.TA2).getName(); + + System.out.println(p); + + } + +// Set res = resSet.results; +// Iterator it = res.iterator(); +// System.out.println("res: " + res.size() + res); +// System.out.println("booooooooo"); // while(it.hasNext()) { // System.out.println(it.next()); // } - Set res = resSet.results; - Iterator it = res.iterator(); - System.out.println("res: " + res.size() + res); - System.out.println("booooooooo"); - while(it.hasNext()) { - System.out.println(it.next()); - } - System.out.println("booooooooo2"); +// System.out.println("booooooooo2"); // for(TPHConstraint tphC: allConstraints) { // } - Predicate filterUndConstraints = ab -> resSet.resolveType((TypePlaceholder)(ab.TA1)).resolvedType instanceof TypePlaceholder; - System.out.println(filterUndConstraints); - Predicate the = x -> resSet.resolveType((TypePlaceholder)(x.TA1)).resolvedType instanceof TypePlaceholder; - ResultPair rp = y -> resSet.resolveType((TypePlaceholder)(y.TA1)).getResultPair(); +// Predicate filterUndConstraints = ab -> resSet.resolveType((TypePlaceholder)(ab.TA1)).resolvedType instanceof TypePlaceholder; +// System.out.println(filterUndConstraints); +// Predicate the = x -> resSet.resolveType((TypePlaceholder)(x.TA1)).resolvedType instanceof TypePlaceholder; +// ResultPair rp = y -> resSet.resolveType((TypePlaceholder)(y.TA1)).getResultPair(); // (resultSet.resolveType((TypePlaceholder)(cs.TA1)).resolvedType instanceof TypePlaceholder)