8028792: (ch) Channels native code needs to be checked for methods calling JNI with pending excepitons
Volker Simonis
volker.simonis at gmail.com
Tue Feb 4 10:35:55 PST 2014
On Sunday, February 2, 2014, Alan Bateman <Alan.Bateman at oracle.com> wrote:
>
> This change updates the JNI usage in several native methods to handle
> exceptions that may potentially be pending after calls to FindClass and
> GetFieldID. It's primarily init methods called in static initializers that
> are updated.
>
> Chris - I checked the SCTP implementation while in the area and there are
> a few updates (I can separate these into another bug if you wish).
>
> Volker - I've taken the liberty of updating AixNativeDispatcher.c but I
> have no way to check the build. If you'd prefer then I can leave this out
> of this change. One other thing is that the native init method returns an
> int/jint but it probably can be void as that would match the other
> platforms.
>
>
Hi Alan,
thanks a lot for taking care of the AIX file as well. I think the changes
are OK, but for all cases I'll do a test build tomorrow and let you know.
You're also right that we can make the init method void and I'd appreciate
it if you could add that to your change in order to align the different
platform implementations.
One other thing I'd like to suggest is to use a uniform usage pattern of
the CHECK macros on all platform. While slightly more verbose,
I'd personally prefer the pattern currently used in the Windows/Unix/AIX
files where the macros are on a separate line and check the value of the
class members:
findFirst_handle = (*env)->GetFieldID(env, clazz, "handle", "J");
CHECK_NULL(findFirst_handle);
instead of the one-liners used in the Linux/BSD/Solaris files:
CHECK_NULL(clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry"));
That's mainly because I don't like these big expressions inside the macro
calls and I think the two line version is much easier to read. But of
course that's you decision.
Regards,
Volker
The webrev with the proposed changes is here:
>
> http://cr.openjdk.java.net/~alanb/8028792/webrev/
>
> Thanks,
> Alan.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20140204/684eff4a/attachment.html
More information about the nio-dev
mailing list