diff --git a/src/main/java/gr/uom/java/xmi/decomposition/UMLOperationBodyMapper.java b/src/main/java/gr/uom/java/xmi/decomposition/UMLOperationBodyMapper.java index b8c533012..e2672d4d8 100644 --- a/src/main/java/gr/uom/java/xmi/decomposition/UMLOperationBodyMapper.java +++ b/src/main/java/gr/uom/java/xmi/decomposition/UMLOperationBodyMapper.java @@ -3056,6 +3056,7 @@ public boolean allMappingsHaveSameDepthAndIndex() { int count = 0; int compositeCount = 0; int identicalCompositeCount = 0; + int identicalLeafCount = 0; for(AbstractCodeMapping mapping : mappings) { AbstractCodeFragment f1 = mapping.getFragment1(); AbstractCodeFragment f2 = mapping.getFragment2(); @@ -3067,9 +3068,14 @@ public boolean allMappingsHaveSameDepthAndIndex() { identicalCompositeCount++; } } + else if(f1 instanceof StatementObject && f2 instanceof StatementObject) { + if(f1.getString().equals(f2.getString())) { + identicalLeafCount++; + } + } } } - if(count == mappings.size() && compositeCount == identicalCompositeCount && compositeCount > 0) { + if(count == mappings.size() && compositeCount == identicalCompositeCount && compositeCount > 0 && identicalLeafCount > 0) { return true; } }