DriverManager.getCallerClassLoader is the native method:
JNIEXPORT jobject JNICALL
Java_java_sql_DriverManager_getCallerClassLoader(JNIEnv *env, jobject this)
{
jclass caller = JVM_GetCallerClass(env, 2);
return caller != 0 ? JVM_GetClassLoader(env, caller) : 0;
}
and is currently compiled into libjava.so.
We should move this native method into its own native library (libjdbc.so for example) or alternatively use sun.reflect.Reflection.getCallerClass instead.
As a temporary solution in Jigsaw then we have changed DriverManager to load "java". This patch should be removed once the fix to JDBC gets to jigsaw/jigsaw.
JNIEXPORT jobject JNICALL
Java_java_sql_DriverManager_getCallerClassLoader(JNIEnv *env, jobject this)
{
jclass caller = JVM_GetCallerClass(env, 2);
return caller != 0 ? JVM_GetClassLoader(env, caller) : 0;
}
and is currently compiled into libjava.so.
We should move this native method into its own native library (libjdbc.so for example) or alternatively use sun.reflect.Reflection.getCallerClass instead.
As a temporary solution in Jigsaw then we have changed DriverManager to load "java". This patch should be removed once the fix to JDBC gets to jigsaw/jigsaw.