private ProtectionDomain preDefineClass(String name,
                                            ProtectionDomain protectionDomain)
    {
        if (!checkName(name))
            throw new NoClassDefFoundError("IllegalName: " + name);

        if ((name != null) && name.startsWith("java.")) {
            throw new SecurityException("Prohibited package name: " +
                                        name.substring(0, name.lastIndexOf('.')));
        }
        if (protectionDomain == null) {
            protectionDomain = getDefaultDomain();
        }

        if (name != null)
            checkCerts(name, protectionDomain.getCodeSource());

        return protectionDomain;
    }