throw new IllegalStateException("No classloader for module " + this);
if (classLoader instanceof BaseClassLoader == false)
return super.getClassLoaderForClass(className);
final BaseClassLoader bcl = (BaseClassLoader) classLoader;
SecurityManager sm = System.getSecurityManager();
if (sm != null)
{
try
{
return AccessController.doPrivileged(new PrivilegedExceptionAction<ClassLoader>()
{
public ClassLoader run() throws Exception
{
return bcl.findClassLoader(className);
}
});
}
catch (PrivilegedActionException e)
{
Throwable t = e.getCause();
if (t instanceof ClassNotFoundException)
throw (ClassNotFoundException) t;
if (t instanceof Error)
throw (Error) t;
if (t instanceof RuntimeException)
throw (RuntimeException) t;
throw new RuntimeException("Error during findClassLoader for " + className, e);
}
}
return bcl.findClassLoader(className);
}