Request for review- RFE 8005716

Mike Duigou mike.duigou at
Wed Mar 6 17:50:16 UTC 2013

Hi Bill;

Some notes from reviewing the JDK side changes.

The example which begins with the name "If the filename argument, " needs to better identify that "L" is an example. (Italics?)


NativeLibrary::fromClass could be final.


In Java_java_lang_ClassLoader_00024NativeLibrary_findBuiltinLib()

These two values are known at compile time. 

int prefixLen = (int) strlen(JNI_LIB_PREFIX); 
int suffixLen = (int) strlen(JNI_LIB_SUFFIX);

Some of the error conditions don't throw exceptions. Such as:

if (cname == NULL) {
   return NULL;

The prefix and suffix are stripped from cname without checking that cname actually contains the prefix or suffix.

if (len > prefixLen) is invariant.


void* getProcessHandle() {
 static void* procHandle = NULL;
 if (procHandle == NULL) {
    procHandle = (void*)dlopen(NULL, RTLD_LAZY);

 return procHandle;

Why is the error handling code commented out?


On Mar 5 2013, at 15:05 , bill.pittore at wrote:

> This request is tied to bugid 8005716 that deals with adding support for statically linked JNI libraries.
> The JEP is here:
> The bug is here:
> The webrevs are here:
> The main piece of functionality is to check for the presence of JNI_OnLoad_libname to determine if the library specified by 'libname' has been statically linked into the VM. If the symbol is found, it is assumed that the library is linked in and will not be dynamically loaded.
> thanks,
> bill

More information about the core-libs-dev mailing list