modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java

modified:   src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
This commit is contained in:
AluAli 2020-11-13 17:24:41 +01:00
parent f0db6cb901
commit 4ac67120a4
2 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ public class FamilyOfGeneratedGenerics {
public static List<ClassConstraint> getClassConstraints(List<TPHConstraint> cs, HashMap<String, PositionFinder.Position> posOfTphs) { //Inputparameter List<TPHConstraint> constraintsSet weg public static List<ClassConstraint> getClassConstraints(List<TPHConstraint> cs, HashMap<String, PositionFinder.Position> posOfTphs) { //Inputparameter List<TPHConstraint> constraintsSet weg
List<ClassConstraint> cs_cl = new ArrayList<>(); List<ClassConstraint> cs_cl = new ArrayList<>();
List<ClassConstraint> classConstraints1 = typeOfANodeOfAField(cs, cs_cl, posOfTphs); List<ClassConstraint> classConstraints1 = typeOfANodeOfAField(cs, posOfTphs);
for (ClassConstraint cons: classConstraints1) { for (ClassConstraint cons: classConstraints1) {
if (!checkForDuplicates(cons, cs_cl)) { if (!checkForDuplicates(cons, cs_cl)) {
cs_cl.add(cons); cs_cl.add(cons);
@ -49,7 +49,7 @@ public class FamilyOfGeneratedGenerics {
* Def. FGG: erste Zeile von cs_cl * Def. FGG: erste Zeile von cs_cl
* {T < .T' | T is a type variable in a type of a node of a field} * {T < .T' | T is a type variable in a type of a node of a field}
*/ */
public static List<ClassConstraint> typeOfANodeOfAField(List<TPHConstraint> allConstraints, List<ClassConstraint> cs_cl, HashMap<String, PositionFinder.Position> posOfTphs) { public static List<ClassConstraint> typeOfANodeOfAField(List<TPHConstraint> allConstraints, HashMap<String, PositionFinder.Position> posOfTphs) {
//RuntimeException re = new RuntimeException("enthält EQUALS-Relation"); //RuntimeException re = new RuntimeException("enthält EQUALS-Relation");
List<ClassConstraint> tempCC= new ArrayList<>(); List<ClassConstraint> tempCC= new ArrayList<>();
for(TPHConstraint allCons: allConstraints){ for(TPHConstraint allCons: allConstraints){

View File

@ -103,7 +103,7 @@ public class FamilyOfGeneratedGenericsTest extends TestCase {
List<ClassConstraint> classConstraints = FamilyOfGeneratedGenerics.getClassConstraints(inputConstraints, tphPositions); List<ClassConstraint> classConstraints = FamilyOfGeneratedGenerics.getClassConstraints(inputConstraints, tphPositions);
System.out.println(classConstraints); System.out.println(classConstraints);
assertFalse(classConstraints.isEmpty()); assertFalse(classConstraints.isEmpty());
//assertTrue(classConstraints.size() == 2); assertTrue(classConstraints.size() == 6);
} }