diff --git a/src/main/java/org/roda/rodain/rules/Rule.java b/src/main/java/org/roda/rodain/rules/Rule.java index 24147f00..88725110 100644 --- a/src/main/java/org/roda/rodain/rules/Rule.java +++ b/src/main/java/org/roda/rodain/rules/Rule.java @@ -5,6 +5,7 @@ import java.util.Collection; import java.util.Collections; import java.util.HashSet; +import java.util.Iterator; import java.util.Map; import java.util.Observable; import java.util.Observer; @@ -282,11 +283,14 @@ public void update(Observable o, Object arg) { sipNodes.remove(sip.getId()); sips.remove(sip.getId()); setChanged(); - - schemaNodes.forEach(schemaNode -> { - if (schemaNode.isRemoved()) - schemaNodes.remove(schemaNode); - }); + + Iterator iter = schemaNodes.iterator(); + while (iter.hasNext()) { + if(iter.next().isRemoved()){ + iter.remove(); + } + } + if (sips.isEmpty() && schemaNodes.isEmpty()) { notifyObservers("Removed rule"); } else