index[hash] = new NodeEntry(entry.getName(), entry.getId());
count++;
return null;
}
if (ie instanceof ChildNodeEntry) {
ChildNodeEntry existing = (ChildNodeEntry) ie;
if (existing.getName().equals(entry.getName())) {
index[hash] = new NodeEntry(entry.getName(), entry.getId());
return existing;
} else {
ContainerEntry ce = createContainerEntry();
ce.getContainer().add(existing);
ce.getContainer().add(entry);
index[hash] = ce;
count++;
return null;
}
}
ContainerEntry ce = (ContainerEntry) ie;
ChildNodeEntries container = ce.getContainer();
ChildNodeEntry existing = container.add(entry);
if (entry.equals(existing)) {
// no-op
return existing;
}
ce.setDirty(container);