{
{   SecurityManager security = System.getSecurityManager(); try{ if (security != null){ security.checkPackageAccess(className); } }catch(SecurityException e){ throw e; }
    public static Class findProviderClass(String className, ClassLoader cl,                                           boolean doFallback)        throws ClassNotFoundException, ConfigurationError    {        Class providerClass;        if (cl == null) {            // XXX Use the bootstrap ClassLoader.  There is no way to            // load a class using the bootstrap ClassLoader that works            // in both JDK 1.1 and Java 2.  However, this should still            // work b/c the following should be true:            //            // (cl == null) iff current ClassLoader == null            //            // Thus Class.forName(String) will use the current            // ClassLoader which will be the bootstrap ClassLoader.            providerClass = Class.forName(className);        } else {            try {                providerClass = cl.loadClass(className);            } catch (ClassNotFoundException x) {                if (doFallback) {                    // Fall back to current classloader                    ClassLoader current = ObjectFactory.class.getClassLoader();                    if (current == null) {                        providerClass = Class.forName(className);                    } else if (cl != current) {                        cl = current;                        providerClass = cl.loadClass(className);                    } else {                        throw x;                    }                } else {                    throw x;                }            }        }        return providerClass;    }