From 8c39c6782ca03bc4187cf99af5233edab6d1f17a Mon Sep 17 00:00:00 2001 From: tsantalis Date: Thu, 5 Dec 2024 08:45:27 -0500 Subject: [PATCH] Skip composite replacements from cyclic replacement check --- .../gr/uom/java/xmi/decomposition/AbstractCodeMapping.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 262b038f9..17af31ee9 100644 --- a/src/main/java/gr/uom/java/xmi/decomposition/AbstractCodeMapping.java +++ b/src/main/java/gr/uom/java/xmi/decomposition/AbstractCodeMapping.java @@ -207,7 +207,8 @@ public void addReplacement(Replacement replacement) { //eliminate cyclic replacements Replacement toRemove = null; for(Replacement r : replacements) { - if(r.getBefore().equals(replacement.getAfter()) && r.getAfter().equals(replacement.getBefore())) { + if(r.getBefore().equals(replacement.getAfter()) && r.getAfter().equals(replacement.getBefore()) && + !r.getType().equals(ReplacementType.COMPOSITE) && !replacement.getType().equals(ReplacementType.COMPOSITE)) { toRemove = r; break; }