mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Added primary path to the properties archived against a node.
Fixed bug in caching of ChildAssociationRef in the ChildAssoc object git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2797 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -77,13 +77,24 @@ public class ChildAssocImpl implements ChildAssoc
|
||||
|
||||
public ChildAssociationRef getChildAssocRef()
|
||||
{
|
||||
boolean trashReference = false;
|
||||
// first check if it is available
|
||||
refReadLock.lock();
|
||||
try
|
||||
{
|
||||
if (childAssocRef != null)
|
||||
{
|
||||
return childAssocRef;
|
||||
// double check that the parent and child node references match those of our reference
|
||||
if (childAssocRef.getParentRef() != parent.getNodeRef() ||
|
||||
childAssocRef.getChildRef() != child.getNodeRef())
|
||||
{
|
||||
trashReference = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// we are sure that the reference is correct
|
||||
return childAssocRef;
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
@@ -95,13 +106,13 @@ public class ChildAssocImpl implements ChildAssoc
|
||||
try
|
||||
{
|
||||
// double check
|
||||
if (childAssocRef == null )
|
||||
if (childAssocRef == null || trashReference)
|
||||
{
|
||||
childAssocRef = new ChildAssociationRef(
|
||||
this.typeQName,
|
||||
getParent().getNodeRef(),
|
||||
parent.getNodeRef(),
|
||||
this.qName,
|
||||
getChild().getNodeRef(),
|
||||
child.getNodeRef(),
|
||||
this.isPrimary,
|
||||
-1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user