Fix for ACE-3284 CMIS: NPE when performing concurrent search and delete operations

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@89211 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrew Hind
2014-10-27 13:27:00 +00:00
parent 2c4b80f1e4
commit 9c13732661
2 changed files with 9 additions and 3 deletions

View File

@@ -194,11 +194,11 @@ public class DBResultSet extends AbstractResultSet
int bulkFetchSize = getBulkFetchSize();
if(bulkFetchSize < 1)
{
nodeRefs[n] = tenantService.getBaseName(nodeDao.getNodePair(dbids.get(n)).getSecond());
NodeRef nodeRef = nodeDao.getNodePair(dbids.get(n)).getSecond();
nodeRefs[n] = nodeRef == null ? null : tenantService.getBaseName(nodeRef);
return;
}
List<Long> fetchList = new ArrayList<Long>(bulkFetchSize);
BitSet done = new BitSet(bulkFetchSize);
int totalHits = dbids.size();
@@ -227,7 +227,8 @@ public class DBResultSet extends AbstractResultSet
nodeDao.cacheNodesById(fetchList);
for (int i = done.nextSetBit(0); i >= 0; i = done.nextSetBit(i+1))
{
nodeRefs[n+i] = tenantService.getBaseName(nodeDao.getNodePair(fetchList.get(i)).getSecond());
NodeRef nodeRef = nodeDao.getNodePair(fetchList.get(i)).getSecond();
nodeRefs[n+1] = nodeRef == null ? null : tenantService.getBaseName(nodeRef);
}
}
}

View File

@@ -645,6 +645,11 @@ public class ACLEntryAfterInvocationProvider implements AfterInvocationProvider,
filteringResultSet.setIncluded(i, true);
NodeRef nodeRef = returnedObject.getNodeRef(i);
if(filteringResultSet.getIncluded(i) && (nodeRef == null))
{
filteringResultSet.setIncluded(i, false);
}
if (filteringResultSet.getIncluded(i) && permissionService.hasReadPermission(nodeRef) == AccessStatus.DENIED)
{