if (result == null)
{
if (repositories == null || repositories.length == 0)
{
result = new AddonRegistryImpl(lock, getLifecycleManager(), new ArrayList<AddonRepository>(
getRepositories()), "ROOT");
getLifecycleManager().addView(result);
}
else
{
result = new AddonRegistryImpl(lock, getLifecycleManager(), Arrays.asList(repositories),
String.valueOf(registryCount++));
getLifecycleManager().addView(result);
getLifecycleManager().forceUpdate();
}
}