Skip to content

Commit

Permalink
Improved matching of class instance creations
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Dec 17, 2024
1 parent 7ef9e17 commit 5f9833d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2817,6 +2817,12 @@ else if(objectCreation1.inlinedStatementBecomesAdditionalArgument(creationCoveri
replacementInfo.addReplacement(replacement);
return replacementInfo.getReplacements();
}
else if(objectCreation1.compatibleName(creationCoveringTheEntireStatement2) && objectCreation1.equalArguments(creationCoveringTheEntireStatement2) && objectCreation1.identicalExpression(creationCoveringTheEntireStatement2)) {
Replacement replacement = new ObjectCreationReplacement(objectCreation1.actualString(),
creationCoveringTheEntireStatement2.actualString(), (ObjectCreation)objectCreation1, creationCoveringTheEntireStatement2, ReplacementType.CLASS_INSTANCE_CREATION);
replacementInfo.addReplacement(replacement);
return replacementInfo.getReplacements();
}
//check if the argument lists are identical after replacements
if(objectCreation1.identicalName(creationCoveringTheEntireStatement2) &&
objectCreation1.identicalExpression(creationCoveringTheEntireStatement2, replacementInfo.getReplacements(), parameterToArgumentMap)) {
Expand Down

0 comments on commit 5f9833d

Please sign in to comment.