Request for review- RFE 8005716

BILL PITTORE bill.pittore at oracle.com
Thu Mar 7 02:51:57 UTC 2013


On 3/6/2013 12:50 PM, Mike Duigou wrote:
> Hi Bill;
>
> Some notes from reviewing the JDK side changes.
>
>
> System.java/Runtime.java:
>
> The example which begins with the name "If the filename argument, " needs to better identify that "L" is an example. (Italics?)
Re-worded that a bit.
> java/lang/ClassLoader.java:
>
> NativeLibrary::fromClass could be final.
Ok.
>
> ClassLoader.c:
>
> 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;
>     }
Fixed.
> The prefix and suffix are stripped from cname without checking that cname actually contains the prefix or suffix.
..._findBuiltinLib is only called after System.mapLibraryName has added 
prefix and suffix.
>
> if (len > prefixLen) is invariant.
Based on System.mapLibraryName always called, then this could just be an 
assert. Unless JNU_GetStringPlatformChars returns some bogus string.
>
> src/solaris/native/common/jni_util_md.c:
>
> 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?
That was just for some debugging. I've removed it.

Thanks for commenting. I'll get a new webrev up shortly.

bill


>
> Mike
>
>
> On Mar 5 2013, at 15:05 , bill.pittore at oracle.com wrote:
>
>> This request is tied to bugid 8005716 that deals with adding support for statically linked JNI libraries.
>>
>> The JEP is here: http://openjdk.java.net/jeps/178
>>
>> The bug is here:http://bugs.sun.com/view_bug.do?bug_id=8005716
>>
>> The webrevs are here:
>>
>> http://cr.openjdk.java.net/~bpittore/8005716/jdk-webrev.00/
>> http://cr.openjdk.java.net/~bpittore/8005716/hs-webrev.00/
>>
>> 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