diff --git a/src/main/java/gr/uom/java/xmi/decomposition/CompositeStatementObject.java b/src/main/java/gr/uom/java/xmi/decomposition/CompositeStatementObject.java index 20649d999f..8c855ab530 100644 --- a/src/main/java/gr/uom/java/xmi/decomposition/CompositeStatementObject.java +++ b/src/main/java/gr/uom/java/xmi/decomposition/CompositeStatementObject.java @@ -511,7 +511,9 @@ else if(statement instanceof StatementObject) { StatementObject statementObject = (StatementObject)statement; list.addAll(statementObject.getMethodInvocations()); for(LambdaExpressionObject lambda : statementObject.getLambdas()) { - list.addAll(lambda.getAllOperationInvocations()); + if(lambda.getString().contains(JAVA.LAMBDA_ARROW)) { + list.addAll(lambda.getAllOperationInvocations()); + } } for(AnonymousClassDeclarationObject anonymous : statementObject.getAnonymousClassDeclarations()) { list.addAll(anonymous.getMethodInvocations()); diff --git a/src/main/java/gr/uom/java/xmi/diff/UMLModelDiff.java b/src/main/java/gr/uom/java/xmi/diff/UMLModelDiff.java index fa76e9c5cd..40342f2262 100644 --- a/src/main/java/gr/uom/java/xmi/diff/UMLModelDiff.java +++ b/src/main/java/gr/uom/java/xmi/diff/UMLModelDiff.java @@ -3807,14 +3807,16 @@ private void checkForMovedAndInlinedOperations(List mapp removedOperationInvocations.add(invocation); } } - for(AbstractCodeMapping mapping : mapper.getMappings()) { - if(mapping.isExact() && mapping.getReplacementsInvolvingMethodInvocation().isEmpty()) { - for(AbstractCall invocation : mapping.getFragment1().getMethodInvocations()) { - for(ListIterator iterator = removedOperationInvocations.listIterator(); iterator.hasNext();) { - AbstractCall matchingInvocation = iterator.next(); - if(invocation == matchingInvocation || invocation.actualString().equals(matchingInvocation.actualString())) { - iterator.remove(); - break; + if(removedOperationInvocations.size() > 0) { + for(AbstractCodeMapping mapping : mapper.getMappings()) { + if(mapping.isExact() && mapping.getReplacementsInvolvingMethodInvocation().isEmpty()) { + for(AbstractCall invocation : mapping.getFragment1().getMethodInvocations()) { + for(ListIterator iterator = removedOperationInvocations.listIterator(); iterator.hasNext();) { + AbstractCall matchingInvocation = iterator.next(); + if(invocation == matchingInvocation || invocation.actualString().equals(matchingInvocation.actualString())) { + iterator.remove(); + break; + } } } }