Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Dec 30, 2024
1 parent 699f585 commit a526d2a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/java/gr/uom/java/xmi/decomposition/AbstractCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,10 @@ public boolean renamedWithNoExpressionAndArgumentIntersection(AbstractCall call,
}

private boolean oneNameContainsTheOther(AbstractCall call) {
return this.getName().contains(call.getName()) || call.getName().contains(this.getName());
}

private boolean oneNameContainsTheOtherLowerCase(AbstractCall call) {
return this.getName().contains(call.getName()) || call.getName().contains(this.getName()) ||
this.getName().toLowerCase().contains(call.getName().toLowerCase()) ||
call.getName().toLowerCase().contains(this.getName().toLowerCase());
Expand Down Expand Up @@ -923,7 +927,7 @@ public boolean identicalWithInlinedStatements(AbstractCall call, Set<Replacement
}

public boolean identicalWithExpressionArgumentSwap(AbstractCall call) {
if(getExpression() != null && call.getExpression() != null && (identicalName(call) || oneNameContainsTheOther(call))) {
if(getExpression() != null && call.getExpression() != null && (identicalName(call) || oneNameContainsTheOtherLowerCase(call))) {
int argumentIndex1 = arguments().indexOf(call.getExpression());
int argumentIndex2 = call.arguments().indexOf(getExpression());
if(argumentIndex1 != -1 && argumentIndex2 != -1 && argumentIndex1 == argumentIndex2) {
Expand All @@ -933,7 +937,7 @@ public boolean identicalWithExpressionArgumentSwap(AbstractCall call) {
}
}
}
else if(getExpression() == null && call.getExpression() != null && (identicalName(call) || oneNameContainsTheOther(call))) {
else if(getExpression() == null && call.getExpression() != null && (identicalName(call) || oneNameContainsTheOtherLowerCase(call))) {
int argumentIndex1 = arguments().indexOf(call.getExpression());
if(argumentIndex1 != -1) {
Set<String> argumentIntersection = argumentIntersection(call);
Expand All @@ -942,7 +946,7 @@ else if(getExpression() == null && call.getExpression() != null && (identicalNam
}
}
}
else if(getExpression() != null && call.getExpression() == null && (identicalName(call) || oneNameContainsTheOther(call))) {
else if(getExpression() != null && call.getExpression() == null && (identicalName(call) || oneNameContainsTheOtherLowerCase(call))) {
int argumentIndex2 = call.arguments().indexOf(getExpression());
if(argumentIndex2 != -1) {
Set<String> argumentIntersection = argumentIntersection(call);
Expand Down

0 comments on commit a526d2a

Please sign in to comment.