Merged V3.2 to HEAD

19524: Fix AVM indexing NPE when running AVMCrawlTestP (if src & dst are both deleted / not there)
    19652: ALF-885 - fix test


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19726 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2010-04-01 11:23:33 +00:00
parent f51ff31bbc
commit 8aeb83d1c9

View File

@@ -271,12 +271,23 @@ public class AVMLuceneIndexerImpl extends AbstractLuceneIndexerImpl<String> impl
// New // New
if (srcDesc == null) if (srcDesc == null)
{ {
index(difference.getDestinationPath()); if (dstDesc == null)
if (dstDesc.isDirectory())
{ {
indexDirectory(dstDesc); // Nothing to do for this case - both are deleted/not there
if (s_logger.isDebugEnabled())
{
s_logger.debug("Skipped - src & dst deleted / not there: "+difference);
}
}
else
{
index(difference.getDestinationPath());
if (dstDesc.isDirectory())
{
indexDirectory(dstDesc);
}
reindexAllAncestors(difference.getDestinationPath());
} }
reindexAllAncestors(difference.getDestinationPath());
} }
// New Delete // New Delete
else if (!srcDesc.isDeleted() && ((dstDesc == null) || dstDesc.isDeleted())) else if (!srcDesc.isDeleted() && ((dstDesc == null) || dstDesc.isDeleted()))
@@ -291,6 +302,10 @@ public class AVMLuceneIndexerImpl extends AbstractLuceneIndexerImpl<String> impl
if ((dstDesc == null) || dstDesc.isDeleted()) if ((dstDesc == null) || dstDesc.isDeleted())
{ {
// Nothing to do for this case - both are deleted/not there // Nothing to do for this case - both are deleted/not there
if (s_logger.isDebugEnabled())
{
s_logger.debug("Skipped - src & dst deleted / not there: "+difference);
}
} }
else else
{ {