RFR: 8282515: More clean up on NativeLibraries just for JNI library use

Maurizio Cimadamore mcimadamore at openjdk.java.net
Wed Mar 2 17:19:58 UTC 2022


On Wed, 2 Mar 2022 17:04:01 GMT, Mandy Chung <mchung at openjdk.org> wrote:

> This patch further cleans up NativeLibraries just for JNI library use.  RawNativeLibraries implements its own native load and unload methods.  In addition, this also fixes the implementation of `RawNativeLibraries::load` not to throw UnsatisfiedLinkError if a library cannot be loaded for any reason but instead returns null.

Looks good - thanks for cleaning up further. I think separating the library implementation makes a lot of sense. There's some duplication at the native level, but that's acceptable IMHO - and probably better than having a shared piece of logic that can work in two very different modes.

src/java.base/share/native/libjava/RawNativeLibraries.c line 98:

> 96:     JVM_UnloadLibrary(handle);
> 97:     JNU_ReleaseStringPlatformChars(env, name, cname);
> 98: }

Watch out for the newline

-------------

Marked as reviewed by mcimadamore (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/7661


More information about the core-libs-dev mailing list