modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
Alis Ansatz zur Bytecodeerzeugung eingesetzt modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGeneratorTypes/MethodAndConstraints.java ToString ausprogramnmiert modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java Einige bytecode-Usecases laufen noch nicht (z.B. Put.jav) Erste Ansaetze versucht. Muss noch erweitert werden.
This commit is contained in:
parent
b46415e45a
commit
c8d4301e5e
@ -169,7 +169,7 @@ public class GeneratedGenericsFinder implements ASTVisitor {
|
||||
|
||||
|
||||
if(ggResult != null) { //Hinzufuegen von Fayez ggResult
|
||||
generatedGenericsForSF.addGenericGeneratorResultClass(ggResult);
|
||||
//generatedGenericsForSF.addGenericGeneratorResultClass(ggResult);
|
||||
}
|
||||
// Fayez Ansatz Ende
|
||||
//*/
|
||||
@ -198,7 +198,7 @@ public class GeneratedGenericsFinder implements ASTVisitor {
|
||||
ggResultAlternative = new GenericsGeneratorResultForClass(className, listOfClassCons, ggRfaM);
|
||||
|
||||
if(ggResultAlternative != null) {//hinzufuegen von Alis ggResult
|
||||
//generatedGenericsForSF.addGenericGeneratorResultClass(ggResultAlternative);
|
||||
generatedGenericsForSF.addGenericGeneratorResultClass(ggResultAlternative);
|
||||
System.out.println(generatedGenericsForSF);
|
||||
}
|
||||
System.out.println(ggResultAlternative);
|
||||
|
@ -29,5 +29,13 @@ public class GenericGeneratorResultsForAllMethods {
|
||||
public List<MethodAndConstraints> getMethodsAndConstraints() {
|
||||
return methodsAndConstraints;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String ret = "";
|
||||
ret = ret + methodsAndConstraints.stream().reduce("", (x,y) -> x + y.toString(), (x,y) -> x + y);
|
||||
//ret = ret + "\n";
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -52,4 +52,8 @@ public class GenericsGeneratorResult {
|
||||
this.equalsTPHs = equalsTPHs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return constraint.toString() + " EqualsTPS: " + equalsTPHs.toString();
|
||||
}
|
||||
}
|
||||
|
@ -73,4 +73,12 @@ public class GenericsGeneratorResultForClass {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String ret = "Classconstraints: ";
|
||||
ret = ret + classConstraints.stream().reduce("", (x,y) -> x + y.toString(), (x,y) -> x + y);
|
||||
ret = ret + "\n" + methodsAndTheirConstraints.toString();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
@ -33,4 +33,14 @@ public class MethodAndConstraints {
|
||||
return constraints;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String ret = methodID + ": ";
|
||||
ret = ret + constraints.stream().reduce("",
|
||||
(x,y) -> x + y.toString(),
|
||||
(x,y) -> x + y);
|
||||
ret = ret + "\n";
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
@ -636,7 +636,20 @@ public class FamilyOfGeneratedGenerics {
|
||||
}
|
||||
}
|
||||
}
|
||||
String key = ((TypePlaceholder)pairExtends2.TA2).getName();
|
||||
Set<String> containedVars = new HashSet<>();
|
||||
String key = ((TypePlaceholder)((resSet.resolveType((TypePlaceholder)pairExtends2.TA2)).resolvedType)).getName();
|
||||
//TODO: containedVars stimmt noch nicht. Ueberpruefen, ob ggf. mit den containedVars möglicherweise auch die anderen Faelle
|
||||
// rEqExRtilde isPairInTExTapostrophe abgedeckt sind => ggf. integrieren
|
||||
posOfTphs.forEach((x,y) -> {
|
||||
if (y.contains(new PairTphMethod<>(PositionFinder.Position.METHOD, methodAndTPH.getId()))) {
|
||||
containedVars.add(x);
|
||||
};
|
||||
}
|
||||
);
|
||||
if (containedVars.stream().filter(v -> tcOfCs.contains(new TPHConstraint(key, v, Relation.EXTENDS)))
|
||||
.count() > 0) {
|
||||
//tempSet2.add(pairExtends2);
|
||||
}
|
||||
if (posOfTphs.containsKey(key)) {
|
||||
if (posOfTphs.get(key).contains(new PairTphMethod<>(PositionFinder.Position.METHOD, methodAndTPH.getId()))) {
|
||||
tempSet2.add(pairExtends2);
|
||||
|
Loading…
Reference in New Issue
Block a user