From 95c8fc06a3a4cc37e7860e716316b120eea9850b Mon Sep 17 00:00:00 2001 From: tsantalis Date: Mon, 20 Jan 2025 21:45:53 -0500 Subject: [PATCH] Improved implementation over previous commit --- .../gr/uom/java/xmi/decomposition/AbstractCodeMapping.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/gr/uom/java/xmi/decomposition/AbstractCodeMapping.java b/src/main/java/gr/uom/java/xmi/decomposition/AbstractCodeMapping.java index 26c71a144..1cb08a506 100644 --- a/src/main/java/gr/uom/java/xmi/decomposition/AbstractCodeMapping.java +++ b/src/main/java/gr/uom/java/xmi/decomposition/AbstractCodeMapping.java @@ -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; @@ -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; }