RFR: Checking for JNI Exceptions in jni_util.c

Alan Bateman Alan.Bateman at oracle.com
Tue Feb 4 20:36:49 UTC 2014

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.
> Webrev:
>   http://cr.openjdk.java.net/~rriggs/webrev-check_exception-8030993/
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.


More information about the core-libs-dev mailing list