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

More clean up on NativeLibraries just for JNI library use

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 19
    • Fix Version/s: 19
    • Component/s: core-libs
    • Labels:
      None

      Description

      More clean up in NativeLibraryImpl and Unloader that are used for JNI library only. RawNativeLibraries implements its own native load and unload methods.

      This is to follow up the feedback on NativeLibraries::load:
         https://mail.openjdk.java.net/pipermail/core-libs-dev/2022-February/086285.html

      NativeLibraries::load calls JVM_LoadLibrary which will throw UnsatisfiedLinkError if it fails to load a native library and throwExceptionIfFail is true. The return value is important for the JNI case
      and calling System::loadLibrary on the system with dynamic linker cache (Big Sur) where throwExceptionIfFail is false. JNI_TRUE return value for non-JNI case (i.e. raw library library mechanism) is confusing to the readers. That should be fixed. We should further clean up and have RawNativeLibraries to have its own native load and unload methods.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mchung Mandy Chung
              Reporter:
              mchung Mandy Chung
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: