From 5b7fec660dca603c98de4ec4372fdbb25766f9d9 Mon Sep 17 00:00:00 2001 From: "pl@gohorb.ba-horb.de" Date: Sat, 6 Feb 2021 09:51:42 +0100 Subject: [PATCH] modified: ../../../../main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java --- .../dhbwstuttgart/bytecode/TPHExtractor.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java b/src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java index 4a5e9ed8..6bc8b6d2 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java @@ -62,7 +62,7 @@ public class TPHExtractor extends AbstractASTWalker { /* * ordnet den Methodennamen ihre jeweiligen Methodenrespraesentationen der abstrakte Syntax in der jeweiligen aktuellen Klasse zu */ - public HashMap nameToField; + public HashMap nameToField; public final HashMap allTPHS = new HashMap<>(); public final List tphsClass = new ArrayList<>(); MethodAndTPH methodAndTph; @@ -233,7 +233,8 @@ public class TPHExtractor extends AbstractASTWalker { .stream() .filter(s -> s instanceof Assign) .forEach(as -> - this.nameToField.put(((AssignToField)(((Assign)as).lefSide)).field.fieldVarName, ((Assign)as).rightSide)); + this.nameToField.put(((AssignToField)(((Assign)as).lefSide)).field.fieldVarName, + ((AssignToField)(((Assign)as).lefSide)).getType())) ; } this.nameToMeth = new HashMap<>(); @@ -287,14 +288,19 @@ public class TPHExtractor extends AbstractASTWalker { || (methodCall.name.equals("apply") && (methodCall.receiver instanceof ExpressionReceiver) && (((ExpressionReceiver)methodCall.receiver).expr instanceof FieldVar) && - nameToField.keySet().contains(fieldOrMethName=((FieldVar)((ExpressionReceiver)methodCall.receiver).expr).fieldVarName) + nameToField.keySet().contains(fieldOrMethName = ((FieldVar)((ExpressionReceiver)methodCall.receiver).expr).fieldVarName) ) ) { - Iterator paraIt = + Iterator paraIt = methodCall.name.equals("apply") - ? ((LambdaExpression)nameToField.get(fieldOrMethName)).params.iterator() - : nameToMeth.get(methodCall.name).getParameterList().iterator(); + ? (FuNTYPE)(resultSet.resolveType((nameToField.get(fieldOrMethName))).resolvedType).GETARGTYPES + : nameToMeth.get(methodCall.name) + .getParameterList() + .getFormalparalist() + .stream() + .map(p -> p.getType()) + .iterator(); methodCall.getArgumentList() .getArguments() .forEach(x -> {