Skip to content

Commit

Permalink
Fix for issue #443
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed May 9, 2024
1 parent d776b60 commit 1f035e5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/gr/uom/java/xmi/decomposition/AbstractCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,19 @@ else if(replacement instanceof MethodInvocationReplacement) {
}
}
}
else if(replacement instanceof VariableReplacementWithMethodInvocation) {
VariableReplacementWithMethodInvocation methodInvocationReplacement = (VariableReplacementWithMethodInvocation)replacement;
AbstractCall invokedOperation = methodInvocationReplacement.getInvokedOperation();
if(invokedOperation.actualString().contains("(")) {
String subString = invokedOperation.actualString().substring(0, invokedOperation.actualString().indexOf("("));
if(replacement.getBefore().startsWith(subString) && replacement.getAfter().startsWith(subString)) {
if(replacement.getBefore().equals(expression1) && (replacement.getAfter().equals(expression2) ||
(parameterToArgumentMap.containsKey(expression2) && replacement.getAfter().equals(parameterToArgumentMap.get(expression2))))) {
return true;
}
}
}
}
}
if(expression1AfterReplacements.equals(expression2)) {
return true;
Expand Down

0 comments on commit 1f035e5

Please sign in to comment.