From a4bc49f5c4d57ea983b5538a0815fa4397781b64 Mon Sep 17 00:00:00 2001 From: AluAli Date: Fri, 13 Nov 2020 00:43:49 +0100 Subject: [PATCH] modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java modified: src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java --- .../bytecode/insertGenerics/FamilyOfGeneratedGenerics.java | 2 +- .../java/insertGenerics/FamilyOfGeneratedGenericsTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java b/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java index 8683cc60..640111d4 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java @@ -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); } diff --git a/src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java b/src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java index d0a2712f..d8c4fb8e 100644 --- a/src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java +++ b/src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java @@ -54,8 +54,8 @@ public class FamilyOfGeneratedGenericsTest extends TestCase { inputConstraints.add(new TPHConstraint("A", "B", TPHConstraint.Relation.EXTENDS)); HashMap 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