Improved streamAPICalls()
@@ -90,6 +90,32 @@ public class UMLOperationBodyMapper implements Comparable<UMLOperationBodyMapper
if(name.equals("stream") || name.equals("filter") || name.equals("forEach")) {
streamAPICalls.add(statement);
}
+ if(containsMethodSignatureOfAnonymousClass(invocation.actualString())) {
+ for(LambdaExpressionObject lambda : statement.getLambdas()) {
+ if(lambda.getBody() != null) {
+ for(OperationInvocation inv : lambda.getBody().getAllOperationInvocations()) {
+ name = inv.getName();
+ if(name.equals("stream") || name.equals("filter") || name.equals("forEach")) {
+ streamAPICalls.add(statement);
+ break;
+ }
+ }
+ }
+ else if(lambda.getExpression() != null) {
+ Map<String, List<OperationInvocation>> methodInvocationMap = lambda.getExpression().getMethodInvocationMap();
+ for(String key : methodInvocationMap.keySet()) {
+ List<OperationInvocation> invocations = methodInvocationMap.get(key);
+ for(OperationInvocation inv : invocations) {
+ name = inv.getName();
+ if(name.equals("stream") || name.equals("filter") || name.equals("forEach")) {
+ streamAPICalls.add(statement);
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
}
}
return streamAPICalls;
@@ -157,6 +183,13 @@ public class UMLOperationBodyMapper implements Comparable<UMLOperationBodyMapper
}
}
}
+ else if(streamAPICalls1.size() > 0 && streamAPICalls2.size() == 0) {
+ for(AbstractCodeFragment streamAPICall : streamAPICalls1) {
+ if(streamAPICall.getLambdas().size() > 0) {
+ expandAnonymousAndLambdas(streamAPICall, leaves1, innerNodes1, new LinkedHashSet<>(), new LinkedHashSet<>(), this.getOperation1().getAnonymousClassList(), codeFragmentOperationMap1, operation1);
+ }
+ }
+ }
UMLOperationDiff operationDiff = new UMLOperationDiff(operation1, operation2);
Map<String, String> parameterToArgumentMap1 = new LinkedHashMap<String, String>();
Map<String, String> parameterToArgumentMap2 = new LinkedHashMap<String, String>();
