diff --git a/source/java/org/alfresco/repo/coci/CheckOutCheckInServiceImpl.java b/source/java/org/alfresco/repo/coci/CheckOutCheckInServiceImpl.java index 13231c61ac..27ea037ff9 100644 --- a/source/java/org/alfresco/repo/coci/CheckOutCheckInServiceImpl.java +++ b/source/java/org/alfresco/repo/coci/CheckOutCheckInServiceImpl.java @@ -728,12 +728,16 @@ public class CheckOutCheckInServiceImpl implements CheckOutCheckInService { List assocs = nodeService.getTargetAssocs(nodeRef, ContentModel.ASSOC_WORKING_COPY_LINK); // It is a 1:1 relationship - if (assocs.size() > 0) + if (assocs.size() == 0) + { + logger.warn("Found node with cm:checkedOut aspect but no association. Current node state: " + nodeService.getNodeStatus(nodeRef)); + } + else if (assocs.size() > 1) + { + logger.warn("Found multiple " + ContentModel.ASSOC_WORKING_COPY_LINK + " association from node: " + nodeRef); + } + else { - if (assocs.size() > 1) - { - logger.warn("Found multiple " + ContentModel.ASSOC_WORKING_COPY_LINK + " association from node: " + nodeRef); - } workingCopy = assocs.get(0).getTargetRef(); } } @@ -749,12 +753,16 @@ public class CheckOutCheckInServiceImpl implements CheckOutCheckInService { List assocs = nodeService.getSourceAssocs(nodeRef, ContentModel.ASSOC_WORKING_COPY_LINK); // It is a 1:1 relationship - if (assocs.size() > 0) + if (assocs.size() == 0) + { + logger.warn("Found node with cm:workingcopy aspect but no association. Current node state: " + nodeService.getNodeStatus(nodeRef)); + } + else if (assocs.size() > 1) + { + logger.warn("Found multiple " + ContentModel.ASSOC_WORKING_COPY_LINK + " association to node: " + nodeRef); + } + else { - if (assocs.size() > 1) - { - logger.warn("Found multiple " + ContentModel.ASSOC_WORKING_COPY_LINK + " associations to node: " + nodeRef); - } original = assocs.get(0).getSourceRef(); } }