Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7172551

DriverManager.getCallerClassLoader should not be in libjava

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • core-libs
    • b43
    • generic
    • generic

      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.

            lancea Lance Andersen
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: