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 00:43:49 +01:00
parent 9cf7cec37b
commit a4bc49f5c4
2 changed files with 3 additions and 3 deletions

View File

@ -55,7 +55,7 @@ public class FamilyOfGeneratedGenerics {
if(posOfTphs.containsKey(allCons.getLeft()) && allCons.getRight()!=null && allCons.getRel()==Relation.EXTENDS) {
for(String tph: posOfTphs.keySet()) {
if(tph == allCons.getLeft() && posOfTphs.get(tph) == PositionFinder.Position.FIELD) {
ClassConstraint consToAdd = new ClassConstraint(allCons.getLeft(), allCons.getRight(), allCons.getRel());
ClassConstraint consToAdd = new ClassConstraint(tph, allCons.getRight(), allCons.getRel());
if (!checkForDuplicates(consToAdd, tempCC)) {
tempCC.add(consToAdd);
}

View File

@ -54,8 +54,8 @@ public class FamilyOfGeneratedGenericsTest extends TestCase {
inputConstraints.add(new TPHConstraint("A", "B", TPHConstraint.Relation.EXTENDS));
HashMap<String, PositionFinder.Position> tphPositions = new HashMap<>();
tphPositions.put("A", PositionFinder.Position.METHOD);
tphPositions.put("B", PositionFinder.Position.FIELD);
tphPositions.put("A", PositionFinder.Position.FIELD);
tphPositions.put("B", PositionFinder.Position.METHOD);
/*
ClassConstraints should be the same as the input constraint