removedNodes.add(key);
// if there were any referrer changes for the removed nodes, we need to process them
ReferrerChanges referrerChanges = referrerChangesForRemovedNodes.get(key);
if (referrerChanges != null) {
EditableDocument doc = documentStore.edit(keyStr, false, acquireLock);
if (doc != null) translator.changeReferrers(doc, referrerChanges);
}
// if the node had any binary properties, make sure we decrement the ref count of each
for (Iterator<Property> propertyIterator = persisted.getProperties(persistedCache); propertyIterator.hasNext();) {
Property property = propertyIterator.next();
if (property.isBinary()) {
Object value = property.isMultiple() ? Arrays.asList(property.getValuesAsArray()) : property.getFirstValue();
translator.decrementBinaryReferenceCount(value, unusedBinaryKeys, null);
}
}
// Note 1: Do not actually remove the document from the documentStore yet; see below (note 2)
}
// Otherwise, the removed node was created in the session (but not ever persisted),
// so we don't have to do anything ...
} else {
// Get the primary and mixin type names; even though we're passing in the session, the two properties
// should be there and shouldn't require a looking in the cache...
Name primaryType = node.getPrimaryType(this);
Set<Name> mixinTypes = node.getMixinTypes(this);
boolean queryable = node.isQueryable(this);
CachedNode persisted = null;
Path newPath = sessionPaths.getPath(node);
NodeKey newParent = node.newParent();
EditableDocument doc = null;
ChangedAdditionalParents additionalParents = node.additionalParents();
if (node.isNew()) {
doc = Schematic.newDocument();
translator.setKey(doc, key);