mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-02 17:35:18 +00:00
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:
parent
19544c2574
commit
0135279f47
@ -14,7 +14,7 @@ import org.springframework.context.ApplicationContextAware;
|
|||||||
* point for access to needed global instances.
|
* point for access to needed global instances.
|
||||||
* @author britt
|
* @author britt
|
||||||
*/
|
*/
|
||||||
class AVMContext implements ApplicationContextAware
|
public class AVMContext implements ApplicationContextAware
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The single instance of an AVMContext.
|
* The single instance of an AVMContext.
|
||||||
|
@ -719,26 +719,32 @@ class AVMRepository
|
|||||||
public Lookup lookup(int version, String path)
|
public Lookup lookup(int version, String path)
|
||||||
{
|
{
|
||||||
Integer count = fLookupCount.get();
|
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)
|
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)
|
if (fLookupCount.get() > 50)
|
||||||
{
|
{
|
||||||
// throw new AVMCycleException("Cycle in lookup.");
|
throw new AVMCycleException("Cycle in lookup.");
|
||||||
}
|
}
|
||||||
String [] pathParts = SplitPath(path);
|
String [] pathParts = SplitPath(path);
|
||||||
AVMStore store = getAVMStoreByName(pathParts[0]);
|
AVMStore store = getAVMStoreByName(pathParts[0]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user