From ed7cc55139e7ab1cd32564d1830935d3d2bcd486 Mon Sep 17 00:00:00 2001 From: AluAli Date: Fri, 27 Nov 2020 15:29:07 +0100 Subject: [PATCH] modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java --- .../GeneratedGenericsFinder.java | 2 +- .../FamilyOfGeneratedGenerics.java | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java b/src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java index d59f4c01..de40fc14 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java @@ -135,7 +135,7 @@ public class GeneratedGenericsFinder implements ASTVisitor { classOrInterface.accept(tphExtractor); //PL 2020-10-16: Ab hier GGenerics implementieren durch Ali //Rueckgabe an generatedGenericsForSF -// fogg = new FamilyOfGeneratedGenerics(tphExtractor); + fogg = new FamilyOfGeneratedGenerics(tphExtractor); // fogg.getClassConstraints(); tphsClass = tphExtractor.tphsClass; diff --git a/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java b/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java index e881614e..882ae9c8 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java @@ -13,7 +13,7 @@ public class FamilyOfGeneratedGenerics { public HashMap posOfTPHs = new HashMap<>(); public FamilyOfGeneratedGenerics(TPHExtractor tphExtractor) { this.allConstraints = tphExtractor.allCons; -// this.posOfTPHs = tphExtractor. + this.posOfTPHs = positionConverter(tphExtractor); } public static List getClassConstraints(List cs, HashMap posOfTphs) { //Inputparameter List constraintsSet weg @@ -232,6 +232,23 @@ public class FamilyOfGeneratedGenerics { } + public HashMap positionConverter(TPHExtractor tphExtractor) { + HashMap convertedPositions = new HashMap<>(); + for(String tph: tphExtractor.allTPHS.keySet()) { + if(tphExtractor.allTPHS.get(tph)) { + convertedPositions.put(tph, PositionFinder.Position.METHOD); + } else { + convertedPositions.put(tph, PositionFinder.Position.FIELD); + } + } + return convertedPositions; + } + +/* public PositionFinder.Position positionConverter(TPHExtractor tphExtractor) { + if(tphExtractor.allTPHS.keySet()) + }*/ + +