protected NodeData getCorrNodeData(final NodeData mergeNode) throws RepositoryException
{
final QPath mergePath = mergeNode.getQPath();
SessionDataManager corrDataManager = corrSession.getTransientNodesManager();
SessionDataManager mergeDataManager = mergeSession.getTransientNodesManager();
NodeTypeDataManager mergeNtManager = mergeSession.getWorkspace().getNodeTypesHolder();
if (mergeNtManager.isNodeType(Constants.MIX_REFERENCEABLE, mergeNode.getPrimaryTypeName(),
mergeNode.getMixinTypeNames()))
{
// by UUID
return (NodeData)corrDataManager.getItemData(mergeNode.getIdentifier());
}
// by location
for (int i = 1; i <= mergePath.getDepth(); i++)
{
final QPath ancesstorPath = mergePath.makeAncestorPath(i);
NodeData mergeAncestor = (NodeData)mergeDataManager.getItemData(ancesstorPath);
if (mergeAncestor != null
&& mergeNtManager.isNodeType(Constants.MIX_REFERENCEABLE, mergeAncestor.getPrimaryTypeName(),
mergeAncestor.getMixinTypeNames()))
{