Skip to content

Commit

Permalink
Improved implementation over previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Jan 21, 2025
1 parent 96c64ee commit 95c8fc0
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,9 @@ else if(stringConcatMatch(initializer, before)) {
}
}
processExtractVariableRefactoring(ref, refactorings);
int size = refactorings.size();
checkForNestedExtractVariable(ref, refactorings, nonMappedLeavesT2, insideExtractedOrInlinedMethod);
if(identical() || ternaryMatch(initializer, before)) {
if(identical() || ternaryMatch(initializer, before) || refactorings.size() > size) {
identicalWithExtractedVariable = true;
}
return;
Expand Down Expand Up @@ -1218,9 +1219,6 @@ else if(stringConcatMatch(initializer, after)) {
}

private boolean identical() {
if(refactorings.size() > 1) {
return true;
}
if(getReplacements().size() == 1 && fragment1.getVariableDeclarations().size() == fragment2.getVariableDeclarations().size()) {
return true;
}
Expand Down

0 comments on commit 95c8fc0

Please sign in to comment.