This fixes spurious cycle exception bug. AVMContext is public to

allow reallybad.jsp to work so that we have a way of browsing and 
modifying content in the AVM repository in a running Alfresco 
instance, until I get AVMNodeService fully hooked up.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3541 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park 2006-08-17 18:30:34 +00:00
parent 19544c2574
commit 0135279f47
2 changed files with 24 additions and 27 deletions

View File

@ -14,7 +14,7 @@ import org.springframework.context.ApplicationContextAware;
* point for access to needed global instances.
* @author britt
*/
class AVMContext implements ApplicationContextAware
public class AVMContext implements ApplicationContextAware
{
/**
* The single instance of an AVMContext.

View File

@ -719,26 +719,32 @@ class AVMRepository
public Lookup lookup(int version, String path)
{
Integer count = fLookupCount.get();
if (count == null)
try
{
fLookupCount.set(1);
if (count == null)
{
fLookupCount.set(1);
}
else
{
fLookupCount.set(count + 1);
}
if (fLookupCount.get() > 50)
{
throw new AVMCycleException("Cycle in lookup.");
}
String [] pathParts = SplitPath(path);
AVMStore store = getAVMStoreByName(pathParts[0]);
Lookup result = store.lookup(version, pathParts[1], false);
return result;
}
else
finally
{
fLookupCount.set(count + 1);
if (count == null)
{
fLookupCount.set(null);
}
}
if (fLookupCount.get() > 50)
{
// throw new AVMCycleException("Cycle in lookup.");
}
String [] pathParts = SplitPath(path);
AVMStore store = getAVMStoreByName(pathParts[0]);
Lookup result = store.lookup(version, pathParts[1], false);
if (count == null)
{
fLookupCount.set(null);
}
return result;
}
/**
@ -789,18 +795,9 @@ class AVMRepository
*/
public Lookup lookupDirectory(int version, String path)
{
Integer count = fLookupCount.get();
if (count == null)
{
fLookupCount.set(1);
}
else
{
fLookupCount.set(count + 1);
}
if (fLookupCount.get() > 50)
{
// throw new AVMCycleException("Cycle in lookup.");
throw new AVMCycleException("Cycle in lookup.");
}
String [] pathParts = SplitPath(path);
AVMStore store = getAVMStoreByName(pathParts[0]);