}
};
Object enhancedResult = null;
ProxyFactory f = new ProxyFactory()
{
@Override
protected ClassLoader getClassLoader0()
{
ClassLoader result = callingLoader;
if (!ClassLoaders.containsClass(result, ProxyObject.class))
result = super.getClassLoader0();
return result;
};
};
f.setUseCache(true);
Class<?> first = hierarchy[0];
if (!first.isInterface())
{
f.setSuperclass(Proxies.unwrapProxyTypes(first, callingLoader, delegateLoader));
hierarchy = Arrays.shiftLeft(hierarchy, new Class<?>[hierarchy.length - 1]);
}
int index = Arrays.indexOf(hierarchy, ProxyObject.class);
if (index >= 0)
{
hierarchy = Arrays.removeElementAtIndex(hierarchy, index);
}
if (!Proxies.isProxyType(first) && !Arrays.contains(hierarchy, ForgeProxy.class))
hierarchy = Arrays.append(hierarchy, ForgeProxy.class);
if (hierarchy.length > 0)
f.setInterfaces(hierarchy);
f.setFilter(filter);
Class<?> c = f.createClass();
enhancedResult = c.newInstance();
try
{
((ProxyObject) enhancedResult)