Skip to content

Commit

Permalink
Improve matching of argumentized strings that differ in "this."
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Jan 8, 2025
1 parent be2b10b commit 12baf5d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,16 @@ public void setMatchingArgumentsWithOperationInvocation(int matchingArgumentsWit
}

public boolean isExact() {
return !fragment1.isKeyword() && (fragment1.getArgumentizedString().equals(fragment2.getArgumentizedString()) || argumentizedStringExactAfterTypeReplacement() ||
return !fragment1.isKeyword() && (argumentizedStringExact() || argumentizedStringExactAfterTypeReplacement() ||
fragment1.getString().equals(fragment2.getString()) || isExactAfterAbstraction() || containsIdenticalOrCompositeReplacement() || callChainMatch());
}

private boolean argumentizedStringExact() {
return fragment1.getArgumentizedString().equals(fragment2.getArgumentizedString()) ||
fragment1.getArgumentizedString().equals("this." + fragment2.getArgumentizedString()) ||
fragment2.getArgumentizedString().equals("this." + fragment1.getArgumentizedString());
}

private boolean callChainMatch() {
String s1 = fragment1.getArgumentizedString();
String s2 = fragment2.getArgumentizedString();
Expand Down

0 comments on commit 12baf5d

Please sign in to comment.