modified: src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java
modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java modified: src/main/java/de/dhbwstuttgart/bytecode/utilities/MethodAndTPH.java Neue Methode addTph modified: src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java Methodcall-Steatements mit Void als Returntyp
This commit is contained in:
parent
c8d4301e5e
commit
3363037854
@ -92,7 +92,7 @@ public class TPHExtractor extends AbstractASTWalker {
|
||||
if (inMethod && !tphsClass.contains(tphName)) {
|
||||
ArrayList<String> tphs = null;
|
||||
if (!(tphs = methodAndTph.getTphs()).contains(tphName)) {
|
||||
tphs.add(tphName);
|
||||
methodAndTph.addTph(tphName);
|
||||
}
|
||||
if (inLocalOrParamOrReturn) {
|
||||
if (!(tphs = methodAndTph.getLocalTphs()).contains(tphName)) {
|
||||
@ -173,7 +173,7 @@ public class TPHExtractor extends AbstractASTWalker {
|
||||
public void visit(GenericRefType genericRefType) {
|
||||
String name = genericRefType.getParsedName();
|
||||
if (inMethod) {
|
||||
methodAndTph.getTphs().add(name);
|
||||
methodAndTph.addTph(name);
|
||||
if (inLocalOrParamOrReturn)
|
||||
methodAndTph.getLocalTphs().add(name);
|
||||
}else {
|
||||
|
@ -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);
|
||||
|
@ -648,7 +648,7 @@ public class FamilyOfGeneratedGenerics {
|
||||
);
|
||||
if (containedVars.stream().filter(v -> tcOfCs.contains(new TPHConstraint(key, v, Relation.EXTENDS)))
|
||||
.count() > 0) {
|
||||
//tempSet2.add(pairExtends2);
|
||||
tempSet2.add(pairExtends2);
|
||||
}
|
||||
if (posOfTphs.containsKey(key)) {
|
||||
if (posOfTphs.get(key).contains(new PairTphMethod<>(PositionFinder.Position.METHOD, methodAndTPH.getId()))) {
|
||||
|
@ -27,7 +27,11 @@ public class MethodAndTPH {
|
||||
this.id = name;
|
||||
this.constraints = constraints;
|
||||
}
|
||||
|
||||
|
||||
public void addTph(String tph) {
|
||||
tphs.add(tph);
|
||||
}
|
||||
|
||||
public ArrayList<String> getTphs() {
|
||||
return tphs;
|
||||
}
|
||||
|
@ -213,7 +213,8 @@ public class StatementGenerator {
|
||||
ArrayList<RefTypeOrTPHOrWildcardOrGeneric> argTypes = argumentList.getArguments().stream()
|
||||
.map(x -> TypePlaceholder.fresh(methodInvocationContext.getStart()))
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
MethodCall ret = new MethodCall(TypePlaceholder.fresh(methodInvocationContext.getStart()),
|
||||
MethodCall ret = new MethodCall(//new Void(new NullToken()),
|
||||
TypePlaceholder.fresh(methodInvocationContext.getStart()),
|
||||
getReceiver(receiver), name, argumentList, TypePlaceholder.fresh(methodInvocationContext.getStart()),
|
||||
argTypes, methodInvocationContext.getStart());
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user