Reflection: Prohibited package name


Estaba invocando una clase para hacer reflexión sobre ella y llamar a un método especifico. Esta clase tenia un paquete que se denomina tal que asi:
java.xxx.yyy.clase.java

Y me salta en las pruebas un error tal que:

java.lang.SecurityException: Prohibited package name: java.xxx.yyy

Motivo: aquellos paquetes que empiezan por ‘java.‘ están «reservados», es decir no se puede hacer reflexión sobre ellos pues en su código fuente así lo especifica. En la clase ClassLoader. Aquí el fragmento:

//...
private ProtectionDomain More 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;
    }
//...
Reflection: Prohibited package name