in src/main/java/org/apache/maven/plugins/shade/pom/MavenJDOMWriter.java [584:616]
protected void iterateNotifier(
Counter counter, Element parent, Collection<Notifier> list, String parentTag, String childTag) {
boolean shouldExist = list != null && list.size() > 0;
Element element = updateElement(counter, parent, parentTag, shouldExist);
if (shouldExist) {
Iterator<Element> elIt =
element.getChildren(childTag, element.getNamespace()).iterator();
if (!elIt.hasNext()) {
elIt = null;
}
Counter innerCount = new Counter(counter.getDepth() + 1);
for (Notifier value : list) {
Element el;
if (elIt != null && elIt.hasNext()) {
el = elIt.next();
if (!elIt.hasNext()) {
elIt = null;
}
} else {
el = factory.element(childTag, element.getNamespace());
insertAtPreferredLocation(element, el, innerCount);
}
updateNotifier(value, childTag, innerCount, el);
innerCount.increaseCount();
}
if (elIt != null) {
while (elIt.hasNext()) {
elIt.next();
elIt.remove();
}
}
}
}