Skip to content

Commit

Permalink
Only add elements if not exists before
Browse files Browse the repository at this point in the history
  • Loading branch information
iitsoftware committed Feb 15, 2023
1 parent 4c3c669 commit 8e10d2a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/com/swiftmq/mgmt/PreConfigurator.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,13 @@ private void processElement(Element changeEle, Element configEle, boolean isPare
break;
case "add":
copy.remove(copy.attribute(OP));
if (!isParent)
configEle.getParent().add(copy);
else
configEle.add(copy);
if (!isParent) {
if (findElement(changeEle, configEle.getParent()) == null) // Add if not exists
configEle.getParent().add(copy);
} else {
if (findElement(changeEle, configEle) == null) // Add if not exists
configEle.add(copy);
}
goDeeper = false;
break;
case "remove":
Expand Down

0 comments on commit 8e10d2a

Please sign in to comment.