Skip to content

Commit

Permalink
Final fix for issue #792
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Oct 28, 2024
1 parent 5d024c6 commit 512227a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static gr.uom.java.xmi.decomposition.Visitor.stringify;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.jdt.core.dom.CompilationUnit;
Expand Down Expand Up @@ -126,6 +127,18 @@ public List<VariableDeclaration> getVariableDeclarations() {
return variableDeclarations;
}

public List<AbstractCall> getAllOperationInvocations() {
List<AbstractCall> list = new ArrayList<>();
list.addAll(getMethodInvocations());
for(LambdaExpressionObject lambda : this.getLambdas()) {
list.addAll(lambda.getAllOperationInvocations());
}
for(AnonymousClassDeclarationObject anonymous : this.getAnonymousClassDeclarations()) {
list.addAll(anonymous.getMethodInvocations());
}
return list;
}

@Override
public List<AbstractCall> getMethodInvocations() {
return methodInvocations;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public List<LambdaExpressionObject> getAllLambdas() {
@Override
public List<AbstractCall> getAllOperationInvocations() {
if(expression != null) {
return new ArrayList<>(expression.getMethodInvocations());
return new ArrayList<>(expression.getAllOperationInvocations());
}
if(body != null) {
return body.getAllOperationInvocations();
Expand Down

0 comments on commit 512227a

Please sign in to comment.