// If the contribution is a placeholder contribution, then the children should be merged into other children ...
if (contribution.isPlaceholder()) {
// Iterate over the children and add only if there is not already one ...
Iterator<Segment> childIterator = contribution.getChildren();
while (childIterator.hasNext()) {
Segment child = childIterator.next();
if (!childNames.containsKey(child.getName())) {
childNames.put(child.getName(), 1);
children.add(pathFactory.createSegment(child.getName()));
}
}
} else {
// Copy the children ...
Iterator<Segment> childIterator = contribution.getChildren();
while (childIterator.hasNext()) {
Segment child = childIterator.next();
int index = Path.NO_INDEX;
Integer previous = childNames.put(child.getName(), 1);
if (previous != null) {
int previousValue = previous.intValue();
// Correct the index in the child name map ...
childNames.put(child.getName(), ++previousValue);
index = previousValue;
}
children.add(pathFactory.createSegment(child.getName(), index));
}
// Copy the properties ...
Iterator<Property> propertyIterator = contribution.getProperties();
while (propertyIterator.hasNext()) {