diff --git a/src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java b/src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java index 6bc8b6d2..7729eb88 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java @@ -287,14 +287,17 @@ public class TPHExtractor extends AbstractASTWalker { if (nameToMeth.keySet().contains(fieldOrMethName = methodCall.name) //Method-call of a method in the actuial Sourcefile || (methodCall.name.equals("apply") && (methodCall.receiver instanceof ExpressionReceiver) && - (((ExpressionReceiver)methodCall.receiver).expr instanceof FieldVar) && - nameToField.keySet().contains(fieldOrMethName = ((FieldVar)((ExpressionReceiver)methodCall.receiver).expr).fieldVarName) + ((((ExpressionReceiver)methodCall.receiver).expr instanceof FieldVar) && + nameToField.keySet().contains(fieldOrMethName = ((FieldVar)((ExpressionReceiver)methodCall.receiver).expr).fieldVarName) + || (((ExpressionReceiver)methodCall.receiver).expr instanceof LocalVar) && + nameToField.keySet().contains(fieldOrMethName = ((LocalVar)((ExpressionReceiver)methodCall.receiver).expr).name) ) - ) + ) + ) { Iterator paraIt = methodCall.name.equals("apply") - ? (FuNTYPE)(resultSet.resolveType((nameToField.get(fieldOrMethName))).resolvedType).GETARGTYPES + ? ((RefType)(resultSet.resolveType((nameToField.get(fieldOrMethName))).resolvedType)).getParaList().iterator() : nameToMeth.get(methodCall.name) .getParameterList() .getFormalparalist() @@ -305,7 +308,7 @@ public class TPHExtractor extends AbstractASTWalker { .getArguments() .forEach(x -> { RefTypeOrTPHOrWildcardOrGeneric left = resultSet.resolveType(x.getType()).resolvedType; - RefTypeOrTPHOrWildcardOrGeneric right = resultSet.resolveType(paraIt.next().getType()).resolvedType; + RefTypeOrTPHOrWildcardOrGeneric right = resultSet.resolveType(paraIt.next()).resolvedType; if (left instanceof TypePlaceholder && methodAndTph.getTphs().contains(((TypePlaceholder)left).getName())) { if (right instanceof TypePlaceholder) { methodAndTph.addPair(allPairs.stream().filter(