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; }