Fixed the detection of lambda bodies extracted into methods in commit
@@ -336,8 +336,14 @@ public class CompositeStatementObject extends AbstractStatement {
}
}
for(LambdaExpressionObject lambda : statementObject.getLambdas()) {
+ Map<String, List<OperationInvocation>> lambdaMap = null;
if(lambda.getBody() != null) {
- Map<String, List<OperationInvocation>> lambdaMap = lambda.getBody().getCompositeStatement().getAllMethodInvocations();
+ lambdaMap = lambda.getBody().getCompositeStatement().getAllMethodInvocations();
+ }
+ else if(lambda.getExpression() != null) {
+ lambdaMap = new LinkedHashMap<String, List<OperationInvocation>>();
+ lambdaMap.putAll(lambda.getExpression().getMethodInvocationMap());
+ }
for(String key : lambdaMap.keySet()) {
if(map.containsKey(key)) {
map.get(key).addAll(lambdaMap.get(key));
@@ -351,7 +357,6 @@ public class CompositeStatementObject extends AbstractStatement {
}
}
}
- }
return map;
}
