RFR: Checking for JNI Exceptions in jni_util.c
roger.riggs at oracle.com
Tue Feb 4 21:05:19 UTC 2014
Updated the webrev with the recommendations.
On 2/4/2014 3:36 PM, Alan Bateman wrote:
> On 04/02/2014 18:11, roger riggs wrote:
>> Hi Alan,
>> Thanks for the review and suggestions; the webrev has been updated
>> with the recommendations.
> The updated webrev looks okay. I note in the JNU_ClassXXX functions
> that the return from NewGlobalRef is not checked but I believe it's
> safe to call DeleteLocalRef even if there is a pending exception.
> One minor comment is that in initializeEncoding it now assumes that
> the reference returned by JNU_ClassString is a global ref (because it
> obtains the reference before expanding the space for local refs). An
> alternative (which might be clearer for future readers) is to do the
> EnsureLocalCapacity first.
Corrected; but I note in reading the jni specification for
that the VM ensures that there is capacity for 16 local references before
calling the native method so checking for smaller numbers is a noop.
More information about the core-libs-dev