{
if (loaderRepository instanceof HeirarchicalLoaderRepository3)
{
boolean parentFirst = ((HeirarchicalLoaderRepository3)loaderRepository).getUseParentFirst();
domain = new BaseClassPoolDomain("Scoped" + System.identityHashCode(loaderRepository), mainDomain, parentFirst);
}
else
{
if (mainDomain == null)
{
domain = new BaseClassPoolDomain(ServerConstants.DEFAULT_LOADER_NAME, null, false);
mainDomain = domain;
}
else
{
domain = mainDomain;