Fixed AssociationRef.equals method that was causing association matching to fail

Fixed node tests that were hiding a NullPointerException when node associations weren't found
Fixed NodeAssoc AssociationRef caching for cases where the source or target nodes move stores
Removed storage of Path property for archived nodes


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2886 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-05-12 22:04:49 +00:00
parent 881f966ee8
commit d8878a46ed
8 changed files with 38 additions and 47 deletions

View File

@@ -74,13 +74,24 @@ public class NodeAssocImpl implements NodeAssoc
public AssociationRef getNodeAssocRef()
{
boolean trashReference = false;
// first check if it is available
refReadLock.lock();
try
{
if (nodeAssocRef != null)
{
return nodeAssocRef;
// double check that the parent and child node references match those of our reference
if (nodeAssocRef.getSourceRef() != source.getNodeRef() ||
nodeAssocRef.getTargetRef() != target.getNodeRef())
{
trashReference = true;
}
else
{
// we are sure that the reference is correct
return nodeAssocRef;
}
}
}
finally
@@ -92,7 +103,7 @@ public class NodeAssocImpl implements NodeAssoc
try
{
// double check
if (nodeAssocRef == null )
if (nodeAssocRef == null || trashReference)
{
nodeAssocRef = new AssociationRef(
getSource().getNodeRef(),