diff --git a/src/main/java/org/codetracker/FileTrackerImpl.java b/src/main/java/org/codetracker/FileTrackerImpl.java index 6cf589cc4ce..e4263b7c87c 100644 --- a/src/main/java/org/codetracker/FileTrackerImpl.java +++ b/src/main/java/org/codetracker/FileTrackerImpl.java @@ -1791,7 +1791,13 @@ private void processNestedStatementsAndComments(UMLModel rightModel, Version cur rightSideOperations.remove(rightMethod.getUmlOperation()); } } - if (containsCallToExtractedMethod(bodyMapper, rightSideOperations)) { + boolean allMapped = + bodyMapper.getNonMappedLeavesT1().size() == 0 && + bodyMapper.getNonMappedLeavesT2().size() == 0 && + bodyMapper.getNonMappedInnerNodesT1().size() == 0 && + bodyMapper.getNonMappedInnerNodesT2().size() == 0 && + bodyMapper.getMappings().size() > 0; + if (!allMapped && containsCallToExtractedMethod(bodyMapper, rightSideOperations)) { UMLModelDiff umlModelDiffLocal = leftModel.diff(rightModel); //this bodyMapper has mapping optimization bodyMapper = findBodyMapper(umlModelDiffLocal, rightMethod, currentVersion, parentVersion); diff --git a/src/main/java/org/codetracker/FileTrackerWithLocalFilesImpl.java b/src/main/java/org/codetracker/FileTrackerWithLocalFilesImpl.java index 37fe5f67be5..1b6c83512de 100644 --- a/src/main/java/org/codetracker/FileTrackerWithLocalFilesImpl.java +++ b/src/main/java/org/codetracker/FileTrackerWithLocalFilesImpl.java @@ -1798,7 +1798,13 @@ private void processNestedStatementsAndComments(UMLModel rightModel, Version cur rightSideOperations.remove(rightMethod.getUmlOperation()); } } - if (containsCallToExtractedMethod(bodyMapper, rightSideOperations)) { + boolean allMapped = + bodyMapper.getNonMappedLeavesT1().size() == 0 && + bodyMapper.getNonMappedLeavesT2().size() == 0 && + bodyMapper.getNonMappedInnerNodesT1().size() == 0 && + bodyMapper.getNonMappedInnerNodesT2().size() == 0 && + bodyMapper.getMappings().size() > 0; + if (!allMapped && containsCallToExtractedMethod(bodyMapper, rightSideOperations)) { UMLModelDiff umlModelDiffLocal = leftModel.diff(rightModel); //this bodyMapper has mapping optimization bodyMapper = findBodyMapper(umlModelDiffLocal, rightMethod, currentVersion, parentVersion);